1const express = require('express')
2const app = express()
3const port = 3000
4
5app.get('/', (req, res) => {
6 res.send('Hello World!')
7})
8
9app.listen(port, () => {
10 console.log(`Example app listening at http://localhost:${port}`)
11})
1const express = require('express')
2
3const app = express()
4
5app.get('/', (req, res, next) => {
6 res.json({
7 message: 'This is my JSON api'
8 });
9});
10
11app.listen(your-port-here, () => {
12 console.log(`listening on http://localhost:${the-port-goes-here}`)
13});
14
15/*
16WombleWoo7547 @ https://github.com/WombleWoo7547 https://replit.com/@WombleWoo7547
17*/
1app.render('email', function (err, html) {
2 // ...
3})
4
5app.render('email', { name: 'Tobi' }, function (err, html) {
6 // ...
7})
8