GET /*
Handle requests to paths that are not defined in the API. It sends the index.html file from the client-side directory.
Endpoint URL
http://127.0.0.1:8080/*
Query Parameters
None as this make sure all paths not defined by other endpoints will lead back to the home page. * is used as a wildcard.
Example Code
app.get('*', (req, res) => {
res.sendFile(path.join(__dirname, 'client-side', 'index.html'));
});
Example Response
The contents of the index.html file.
Response Code
200 OK : Returns the
index.html
file.
Response Field
Simply serves the
index.html
file from the client-side directory.
Last updated