From 2e3d833ec4521eb3a4093f27e82d7d53e7f845b4 Mon Sep 17 00:00:00 2001 From: Typicode Date: Sun, 16 Nov 2014 18:13:19 +0100 Subject: [PATCH] Fix default index --- src/index.js | 4 ++-- {public => src/public}/favicon.ico | Bin {public => src/public}/images/json.png | Bin {public => src/public}/index.html | 0 {public => src/public}/stylesheets/style.css | 0 test/index.js | 2 +- 6 files changed, 3 insertions(+), 3 deletions(-) rename {public => src/public}/favicon.ico (100%) rename {public => src/public}/images/json.png (100%) rename {public => src/public}/index.html (100%) rename {public => src/public}/stylesheets/style.css (100%) diff --git a/src/index.js b/src/index.js index 5980b0c..7d462ef 100644 --- a/src/index.js +++ b/src/index.js @@ -41,7 +41,7 @@ module.exports = function(object, filename) { if (fs.existsSync(process.cwd() + '/public')) { server.use(serveStatic(process.cwd() + '/public')); } else { - server.use(serveStatic(path.join(__dirname, './public'))); + server.use(serveStatic(__dirname + '/public')); } server.use(cors({ origin: true, credentials: true })) @@ -66,4 +66,4 @@ module.exports = function(object, filename) { } return server -} \ No newline at end of file +} diff --git a/public/favicon.ico b/src/public/favicon.ico similarity index 100% rename from public/favicon.ico rename to src/public/favicon.ico diff --git a/public/images/json.png b/src/public/images/json.png similarity index 100% rename from public/images/json.png rename to src/public/images/json.png diff --git a/public/index.html b/src/public/index.html similarity index 100% rename from public/index.html rename to src/public/index.html diff --git a/public/stylesheets/style.css b/src/public/stylesheets/style.css similarity index 100% rename from public/stylesheets/style.css rename to src/public/stylesheets/style.css diff --git a/test/index.js b/test/index.js index eb92355..910e32e 100644 --- a/test/index.js +++ b/test/index.js @@ -253,7 +253,7 @@ describe('Server', function() { it('should respond with html', function(done) { request(server) .get('/') - .expect('Content-Type', /html/) + .expect(/You're successfully running JSON Server/) .expect(200, done); }); });