Update README.md

This commit is contained in:
Camel Aissani 2016-07-10 01:34:42 +02:00 committed by GitHub
parent db13c4fe0c
commit cd94fe18ed

View File

@ -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();
```