mirror of
https://gitlab.silvrtree.co.uk/martind2000/frontexpress.git
synced 2025-01-11 21:55:09 +00:00
Update README.md
This commit is contained in:
parent
db13c4fe0c
commit
cd94fe18ed
@ -14,6 +14,13 @@ app.get('/', (req, res) => {
|
||||
window.alert('Hello World');
|
||||
});
|
||||
|
||||
// listen HTTP GET request on API (/api/xxx)
|
||||
// update page content with response
|
||||
app.get(/^\/api\//, (req, res, next) => {
|
||||
document.querySelector('.content').innerHTML = res.responseText;
|
||||
next();
|
||||
});
|
||||
|
||||
// start listening frontend application requests
|
||||
app.listen();
|
||||
```
|
||||
|
Loading…
Reference in New Issue
Block a user