-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 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
1 parent
ec98377
commit dda83c5
Showing
8 changed files
with
1,978 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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": { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
# macOS | ||
.DS_Store | ||
|
||
# Logs | ||
logs | ||
*.log | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
EXPRESS_PORT= | ||
DB_HOST= | ||
DB_PORT= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}`); | ||
}); |
Oops, something went wrong.