Reputation:
I am using webpack to serve my files. I want to get following file.
localhost:5000/callback.html
when I give url. like
localhost:5000/logincallback
How to do that.
Upvotes: 0
Views: 998
Reputation: 12711
In your webpack devServer config, you can get access to the Express app object and configure a handler for the '/logincallback' route.
Here's a sample devServer section of a larger webpack config object:
devServer: {
historyApiFallback: true,
noInfo: true,
setup(app){
app.get('/logincallback', function(req, res) {
res.sendFile(path.join(__dirname + '/callback.html'));
});
}
},
Upvotes: 1