mirror of
https://github.com/typicode/json-server.git
synced 2025-07-29 13:14:12 +08:00
Fix default index
This commit is contained in:
@ -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
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 318 B After Width: | Height: | Size: 318 B |
Before Width: | Height: | Size: 278 B After Width: | Height: | Size: 278 B |
@ -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);
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user