Skip to content

Commit

Permalink
Add Node.js Express Server Module
Browse files Browse the repository at this point in the history
  • Loading branch information
chs1234 committed Nov 10, 2019
1 parent bde2844 commit c709d50
Show file tree
Hide file tree
Showing 22 changed files with 16,086 additions and 13,380 deletions.
23 changes: 23 additions & 0 deletions client/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
File renamed without changes.
13,472 changes: 13,472 additions & 0 deletions client/package-lock.json

Large diffs are not rendered by default.

32 changes: 32 additions & 0 deletions client/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"name": "management",
"version": "0.1.0",
"private": true,
"dependencies": {
"@material-ui/core": "^4.6.0",
"react": "^16.11.0",
"react-dom": "^16.11.0",
"react-scripts": "3.2.0"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
15,881 changes: 2,531 additions & 13,350 deletions package-lock.json

Large diffs are not rendered by default.

45 changes: 15 additions & 30 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,32 +1,17 @@
{
"name": "management",
"version": "0.1.0",
"private": true,
"dependencies": {
"@material-ui/core": "^4.6.0",
"react": "^16.11.0",
"react-dom": "^16.11.0",
"react-scripts": "3.2.0"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
"name": "management",
"version": "1.0.0",
"scripts": {
"client": "cd client && yarn start",
"server": "nodemon server.js",
"dev": "concurrently --kill-others-on-fail \"yarn server\" \"yarn client\""
},
"dependencies": {
"body-parser": "^1.19.0",
"express": "^4.17.1",
"nodemon": "^1.19.4"
},
"devDependencies": {
"concurrently": "^4.0.1"
}
}
13 changes: 13 additions & 0 deletions server.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const express = require('express');
const bodyParser = require('body-parser');
const app = express();
const port = process.env.PORT || 5000;

app.use(bodyParser.json());
app.use(bodyParser.urlencoded({extended: true}));

app.get('/api/hello', (req, res) => {
res.send({message: 'Hello Express!'});
});

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

0 comments on commit c709d50

Please sign in to comment.