node js with express tutorial web api code example
Example: how to set up an express api nodejs
const express = require('express')
const app = express()
app.get('/', (req, res, next) => {
res.json({
message: 'This is my JSON api'
});
});
app.listen(your-port-here, () => {
console.log(`listening on http://localhost:${the-port-goes-here}`)
});
/*
WombleWoo7547 @ https://github.com/WombleWoo7547 https://replit.com/@WombleWoo7547
*/