mirror of
https://github.com/typicode/json-server.git
synced 2025-07-28 12:43:18 +08:00
Fix #1079 404 error on home page
This commit is contained in:
Before Width: | Height: | Size: 318 B After Width: | Height: | Size: 318 B |
@ -9,7 +9,7 @@ const bodyParser = require('./body-parser')
|
||||
|
||||
module.exports = function(opts) {
|
||||
const userDir = path.join(process.cwd(), 'public')
|
||||
const defaultDir = path.join(__dirname, '../front')
|
||||
const defaultDir = path.join(__dirname, '../../public')
|
||||
const staticDir = fs.existsSync(userDir) ? userDir : defaultDir
|
||||
|
||||
opts = Object.assign({ logger: true, static: staticDir }, opts)
|
||||
|
Reference in New Issue
Block a user