Skip to content
Permalink
Browse files

Setup Express server, babel-node and nodemon

  • Loading branch information...
bhubr committed Aug 31, 2019
1 parent d1f0aad commit f54053b91b4a0ef47ba762af74d212a6be88144f
Showing with 3,221 additions and 0 deletions.
  1. +3 −0 packages/back/.babelrc
  2. +1 −0 packages/back/.gitignore
  3. +24 −0 packages/back/package.json
  4. +15 −0 packages/back/src/index.js
  5. +3,178 −0 packages/back/yarn.lock
@@ -0,0 +1,3 @@
{
"presets": ["@babel/preset-env"]
}
@@ -0,0 +1 @@
node_modules
@@ -0,0 +1,24 @@
{
"name": "back",
"version": "0.0.1",
"description": "",
"main": "build/index.js",
"scripts": {
"start": "nodemon --exec ./node_modules/@babel/node/bin/babel-node.js src/index",
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"body-parser": "^1.19.0",
"express": "^4.17.1"
},
"devDependencies": {
"@babel/cli": "^7.5.5",
"@babel/core": "^7.5.5",
"@babel/node": "^7.5.5",
"@babel/preset-env": "^7.5.5",
"nodemon": "^1.19.1"
}
}
@@ -0,0 +1,15 @@
// src/index.js
import express from 'express';
import bodyParser from 'body-parser';

const port = process.env.PORT || 5000;
const app = express();

app.listen(port, (err) => {
if (err) {
console.error(`ERROR: ${err.message}`);
} else {
console.log(`Listening on port ${port}`);
}
});

0 comments on commit f54053b

Please sign in to comment.
You can’t perform that action at this time.