Fakultas Ilmu Komputer UI

Commit 0991be43 authored by Fijar Lazuardy's avatar Fijar Lazuardy
Browse files

containerizing

parent 2c530de4
version: '3'
services:
api:
build:
context: .
dockerfile: Dockerfile
image: jitsi-no-jutsu-backend
container_name: JitsiNoJutsu
volumes:
- '.:/usr/src/app'
- '/usr/src/app/node_modules'
ports:
- "8000:8000"
\ No newline at end of file
......@@ -4,8 +4,7 @@ const express = require('express');
const bodyParser = require('body-parser');
// Constants
const PORT = 8080;
const HOST = '0.0.0.0';
const PORT = 8000;
// App
const app = express();
......@@ -13,13 +12,13 @@ const app = express();
app.use(bodyParser.urlencoded({ extended: true }));
app.use(bodyParser.json());
var routes = require('./routes');
routes(app);
app.get('/', (req, res) => {
res.send('Hello World');
});
res.status(200).json({
'message': "Hello World!"
})
})
app.listen(PORT, HOST);
console.log(`Running on http://${HOST}:${PORT}`);
\ No newline at end of file
app.listen(PORT);
console.log('Server listening on port: ' + PORT);
\ No newline at end of file
......@@ -5,7 +5,7 @@
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node server.js"
"start": "node index.js"
},
"dependencies": {
"body-parser": "^1.19.0",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment