first example nodejs

main
Leonardo Mendoza 11 hours ago
commit 4d0d4ac7e8

@ -0,0 +1,12 @@
const express = require('express');
const app = express();
const http = require('http');
const server = http.createServer(app);
app.get('/', (req, res) => {
res.send('<h1> Hello Leonard!</h1>');
});
server.listen(3333, () => {
console.log('Listen on port 3333');
});

@ -0,0 +1,15 @@
{
"name": "nodejs-first-example",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"express": "^4.22.3"
}
}
Loading…
Cancel
Save