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'); ...@@ -4,8 +4,7 @@ const express = require('express');
const bodyParser = require('body-parser'); const bodyParser = require('body-parser');
// Constants // Constants
const PORT = 8080; const PORT = 8000;
const HOST = '0.0.0.0';
// App // App
const app = express(); const app = express();
...@@ -13,13 +12,13 @@ const app = express(); ...@@ -13,13 +12,13 @@ const app = express();
app.use(bodyParser.urlencoded({ extended: true })); app.use(bodyParser.urlencoded({ extended: true }));
app.use(bodyParser.json()); app.use(bodyParser.json());
var routes = require('./routes'); var routes = require('./routes');
routes(app);
app.get('/', (req, res) => { app.get('/', (req, res) => {
res.send('Hello World'); res.status(200).json({
}); 'message': "Hello World!"
})
})
app.listen(PORT, HOST); app.listen(PORT);
console.log(`Running on http://${HOST}:${PORT}`); console.log('Server listening on port: ' + PORT);
\ No newline at end of file \ No newline at end of file
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"test": "echo \"Error: no test specified\" && exit 1", "test": "echo \"Error: no test specified\" && exit 1",
"start": "node server.js" "start": "node index.js"
}, },
"dependencies": { "dependencies": {
"body-parser": "^1.19.0", "body-parser": "^1.19.0",
......
Supports Markdown
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