Skip to content

Commit

Permalink
Merge pull request azer#2 from nlacasse/frame-with-queryparams
Browse files Browse the repository at this point in the history
Frame with queryparams
  • Loading branch information
jxson committed Oct 31, 2014
2 parents 657522a + 0afb020 commit 8e35ff9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions lib/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ var prettifyError = require("prettify-error");
var WebSocket = require("faye-websocket");
var mime = require("mime");
var execFirst = require("./exec-first");
var url = require('url');

var nodeTemplate = require("./node-template");
var nodeReporter = require("./node-reporter");
Expand Down Expand Up @@ -59,8 +60,9 @@ function start (files, command) {
read.on('update', onSourceCodeChange.publish);

if (command.frame) {
customFrameURL = path.join('/assets/in', command.frame);
routes[customFrameURL] = customFrame(command.frame);
var framePathname = url.parse(command.frame).pathname;
customFrameURL = path.join('/assets/in', framePathname);
routes[customFrameURL] = customFrame(framePathname);
}

routes['/assets/in/:filename([\\w\\.\\/-]+)'] = localAsset;
Expand Down Expand Up @@ -296,5 +298,5 @@ function customFrame (filename) {
}

function setContentType (req, res) {
res.setHeader('Content-Type', mime.lookup(req.url));
res.setHeader('Content-Type', mime.lookup(url.parse(req.url).pathname));
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"prova": "./bin/prova"
},
"scripts": {
"test": "node test.js"
"test": "prova test/*"
},
"dependencies": {
"new-command": "0.0.3",
Expand Down

0 comments on commit 8e35ff9

Please sign in to comment.