from github to this gitea
This commit is contained in:
19
express JS hello world.md
Normal file
19
express JS hello world.md
Normal file
@@ -0,0 +1,19 @@
|
||||
up::[[express JS]]
|
||||
#informatique/javascript
|
||||
|
||||
```js
|
||||
// server-express.js
|
||||
const express = require('express')
|
||||
const app = express() // initialize app
|
||||
const port = 3000
|
||||
|
||||
// GET callback function returns a response message
|
||||
app.get('/', (req, res) => {
|
||||
res.send('Hello World! Welcome to Node.js')
|
||||
})
|
||||
|
||||
app.listen(port, () => {
|
||||
console.log(`Server listening at http://localhost:${port}`)
|
||||
})
|
||||
|
||||
```
|
||||
Reference in New Issue
Block a user