Skip to content

Commit

Permalink
Jsaem2-9 setup backend project (#1)
Browse files Browse the repository at this point in the history
* JSAEM2-9 setup backend expressJS and redis connection

* JSAEM2-9 style: add empty line at the end of file

* JSAEM2-9 feat: reply 404 for all unmatched requests

* JSAEM2-9 fixed: applied required changes from QA
  • Loading branch information
MichaelCTH authored and ikarasz committed Dec 16, 2019
1 parent ec98377 commit dda83c5
Show file tree
Hide file tree
Showing 8 changed files with 1,978 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"env": {
"commonjs": true,
"es6": true,
"node": true
},
"extends": [
"airbnb-base"
],
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"parserOptions": {
"ecmaVersion": 2018
},
"rules": {
}
}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# macOS
.DS_Store

# Logs
logs
*.log
Expand Down
3 changes: 3 additions & 0 deletions ENV_EXAMPLE
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
EXPRESS_PORT=
DB_HOST=
DB_PORT=
18 changes: 18 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
const express = require('express');
const debug = require('debug')('Emerald');
const cors = require('cors');
require('dotenv').config();

const app = express();
const indexRouter = require('./routes/index');

// middleware setup
app.use(cors());
app.use(express.json());

// Route
app.use('/', indexRouter);

app.listen(process.env.EXPRESS_PORT, () => {
debug(`Server is running at port::${process.env.EXPRESS_PORT}`);
});
Loading

0 comments on commit dda83c5

Please sign in to comment.