commit 077be04f5ef2776f0e0745b12c1d19916ece1a43 Author: dariolesa Date: Thu Oct 15 09:52:06 2026 -0600 First nodejs example diff --git a/index.js b/index.js new file mode 100644 index 0000000..93ab195 --- /dev/null +++ b/index.js @@ -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('

Hello Dario!

'); + }); + +server.listen(3333, () => { + console.log('listen on port 3333'); +}); diff --git a/package.json b/package.json new file mode 100644 index 0000000..67a7230 --- /dev/null +++ b/package.json @@ -0,0 +1,14 @@ +{ + "name": "nodejs-first-example", + "version": "1.0.0", + "description": "first node js example to see how it works", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "", + "license": "ISC", + "dependencies": { + "express": "^4.22.3" + } +}