mirror of
https://github.com/seejohnrun/haste-server.git
synced 2024-11-01 03:21:21 +00:00
Light refactor
This commit is contained in:
parent
7756e38595
commit
f22f347d43
1 changed files with 5 additions and 4 deletions
|
@ -80,13 +80,14 @@ http.createServer(function(request, response) {
|
||||||
|
|
||||||
var incoming = url.parse(request.url, false);
|
var incoming = url.parse(request.url, false);
|
||||||
|
|
||||||
|
var handler = null;
|
||||||
if (incoming.pathname.indexOf('/documents') === 0) {
|
if (incoming.pathname.indexOf('/documents') === 0) {
|
||||||
var handler = new DocumentHandler();
|
handler = new DocumentHandler();
|
||||||
handler.handle(request, response);
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
var handler = new StaticHandler('./static');
|
handler = new StaticHandler('./static');
|
||||||
handler.handle(request, response);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
handler.handle(request, response);
|
||||||
|
|
||||||
}).listen(7777);
|
}).listen(7777);
|
||||||
|
|
Loading…
Reference in a new issue