Files

27 lines
540 B
Markdown
Raw Normal View History

2018-10-12 15:37:13 -04:00
---
title: Start a Working Express Server
---
# Start a Working Express Server
2018-10-12 15:37:13 -04:00
---
## Hints
### Hint 1
2018-10-12 15:37:13 -04:00
If you had a website at "example.com/" and wanted to serve a string such as "Hello Express" to whoever visits the root domain you could do so easily using Node and/or express:
2018-10-12 15:37:13 -04:00
```javascript
app.get("/", function(req, res) {
res.send("Hello Express");
2018-10-12 15:37:13 -04:00
});
```
Also, with the modern ES6 syntax you can save a few keystrokes by using arrow functions:
2018-10-12 15:37:13 -04:00
```javascript
app.get("/", (req, res) => {
res.send("Hello Express");
2018-10-12 15:37:13 -04:00
});
```