Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Hamada Gasmallah committed Nov 10, 2022
0 parents commit 14206b9
Show file tree
Hide file tree
Showing 7 changed files with 758 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
2 changes: 2 additions & 0 deletions backend/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules

10 changes: 10 additions & 0 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM node:latest

RUN mkdir -p /var/app/
WORKDIR /var/app

COPY . .

RUN npm i

CMD npm run start
21 changes: 21 additions & 0 deletions backend/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const express = require('express');
const morgan = require('morgan');
const cors = require('cors');

const port = process.env['APP_PORT'] || 3000;

const app = express();
app.use( morgan('combined') );
app.use(cors());

app.get('/api/status', (req, res)=>{
res.sendStatus(200);
});

app.get('/api/hello', (req, res)=>{
res.send("HELLO FROM THE BACKEND!");
});

app.listen(port, ()=>{
console.log(`Listening on port ${port}`);
});
Loading

0 comments on commit 14206b9

Please sign in to comment.