Skip to content

Commit 78ac0b0

Browse files
Contagious06arv
authored andcommitted
* Fixed windows serve, see #336. (#581)
1 parent 7c7d56c commit 78ac0b0

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/serve/server.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ var http = require('http'),
22
mime = require('mime'),
33
util = require('util'),
44
EventEmitter = require('events').EventEmitter,
5-
liveReload = require('tiny-lr');
5+
liveReload = require('tiny-lr'),
6+
sep = require('path').sep;
67

78
/**
89
* A static file server designed to support documentation.js's --serve
@@ -53,9 +54,11 @@ Server.prototype.handler = function (request, response) {
5354
if (path === '') {
5455
path = 'index.html';
5556
}
57+
5658
for (var i = 0; i < this._files.length; i++) {
5759
var file = this._files[i];
58-
if (file.relative === path) {
60+
var filePath = file.relative.split(sep).join('/');
61+
if (filePath === path) {
5962
response.writeHead(200, { 'Content-Type': mime.lookup(path) });
6063
response.end(file.contents);
6164
return;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy