Browse Source

init nodejs

master
xrazis 5 years ago
parent
commit
62af6f5442
  1. 16
      hello_world/app.js
  2. 13
      hello_world/package.json

16
hello_world/app.js

@ -0,0 +1,16 @@
'use strict';
const express = require('express');
// Constants
const PORT = 3000;
const HOST = '0.0.0.0';
// App
const app = express();
app.get('/', (req, res) => {
res.send('Hello World');
});
app.listen(PORT, HOST);
console.log(`Running on http://${HOST}:${PORT}`);

13
hello_world/package.json

@ -0,0 +1,13 @@
{
"name": "docker_web_app",
"version": "1.0.0",
"description": "Node.js on Docker",
"author": "First Last <first.last@example.com>",
"main": "server.js",
"scripts": {
"start": "node server.js"
},
"dependencies": {
"express": "^4.16.1"
}
}
Loading…
Cancel
Save