2018-10-12 15:37:13 -04:00
---
title: Start a Working Express Server
---
2019-07-24 00:59:27 -07:00
# Start a Working Express Server
2018-10-12 15:37:13 -04:00
2019-07-24 00:59:27 -07:00
---
## Hints
### Hint 1
2018-10-12 15:37:13 -04:00
2019-07-02 07:05:15 +05:30
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) {
2019-07-02 07:05:15 +05:30
res.send("Hello Express");
2018-10-12 15:37:13 -04:00
});
```
2019-07-02 07:05:15 +05:30
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) => {
2019-07-02 07:05:15 +05:30
res.send("Hello Express");
2018-10-12 15:37:13 -04:00
});
```