I'm trying to configure fusebox so that it serves my app in root but also an API (for testing only) with /api.
With webpack I managed to get this with the following
devServer: {
setup: function (app) {
app.use('/api', jsonServer.router('db.json'));
}
}
so when I get to http://localhost:8080 I get my app index.html, but when I type http://localhost:8080/api I get the contents of db.json, so I can mock an API Rest that returns json data.
In fusebox I'm using this:
fuse.dev(server => {
const app = server.httpServer.app;
app.use('/api', jsonServer.router('db.json'));
});
and my app is being served in http://localhost:4444, but when I try http://localhost:4444/api, there's nothing. I tried this:
fuse.dev({ root: false }, server => {
const app = server.httpServer.app;
app.use('/api', jsonServer.router('db.json'));
});
And then the API works in http://localhost:4444/api, but then I can´t get to http://localhost:4444, so I can´t load my app.
What am I doing wrong? Thanks.