Skip to content

Commit

Permalink
fix the api path
Browse files Browse the repository at this point in the history
  • Loading branch information
mrhammadasif committed Dec 10, 2024
1 parent 2739ab2 commit a579ead
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions server.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,7 @@ app.use(`${config.app.basePath}/config.json`, (_, res) => {
res.json(config)
})

app.use(history({
index: `${config.app.basePath}/index.html`,
verbose: true,
}))

app.use(config.app.basePath, staticFileMiddleware)
app.use('/api', (req, res, next) => {
app.use(`${config.app.basePath}/api`, (req, res, next) => {
req.body = req.body || {}
req.body = {
...req.body,
Expand All @@ -35,6 +29,13 @@ app.use('/api', (req, res, next) => {
noCors: true
}), jsonServer.router('./mockdata/adminapi/db.json'))

app.use(history({
index: `${config.app.basePath}/index.html`,
verbose: true,
}))

app.use(config.app.basePath, staticFileMiddleware)

app.listen(process.env.PORT || 8598, () => {
console.table(config.app)
console.log(config.app.basePath)
Expand Down

0 comments on commit a579ead

Please sign in to comment.