Skip to content

Commit

Permalink
Move server to new folder
Browse files Browse the repository at this point in the history
  • Loading branch information
robertistok committed Apr 2, 2017
1 parent 7116577 commit df47040
Show file tree
Hide file tree
Showing 24 changed files with 620 additions and 23 deletions.
6 changes: 2 additions & 4 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "client",
"version": "0.1.0",
"private": true,
"proxy": "http//localhost:3001/",
"proxy": "http//localhost:3001",
"dependencies": {
"axios": "^0.15.3",
"history": "^4.6.1",
Expand All @@ -14,6 +14,7 @@
"react-scripts": "0.9.5",
"redux": "^3.6.0",
"redux-form": "^6.5.0",
"redux-immutable-state-invariant": "^2.0.0",
"redux-logger": "^2.10.2",
"redux-storage": "^4.1.2",
"redux-storage-decorator-debounce": "^1.1.3",
Expand All @@ -24,9 +25,6 @@
"semantic-ui": "^2.2.9",
"semantic-ui-react": "^0.67.2"
},
"devDependencies": {
"redux-immutable-state-invariant": "^2.0.0"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
Expand Down
23 changes: 6 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,18 @@
"private": true,
"main": "index.js",
"license": "MIT",
"engines": {
"node": "7.4.0"
},
"dependencies": {
"babel-cli": "^6.24.0",
"babel-core": "^6.24.0",
"bcrypt-nodejs": "^0.0.3",
"body-parser": "^1.17.1",
"cors": "^2.8.1",
"express": "^4.15.2",
"jwt-simple": "^0.5.1",
"mongoose": "^4.9.0",
"morgan": "^1.8.1",
"passport": "^0.3.2",
"passport-jwt": "^2.2.1",
"passport-local": "^1.0.0"
"concurrently": "^3.4.0"
},
"scripts": {
"server": "node server.js",
"client": "node start-client.js",
"start": "concurrently \"npm run server\" \"npm run client \"",
"lint": "eslint ."
"install": "(cd client && yarn) && (cd server && yarn)",
"start": "concurrently \"cd client && PORT=3000 yarn start\" \"cd server && PORT=3001 yarn start\""
},
"devDependencies": {
"babel-eslint": "^7.1.1",
"concurrently": "^3.4.0",
"eslint": "^3.18.0",
"eslint-config-airbnb": "^14.1.0",
"eslint-plugin-import": "^2.2.0",
Expand Down
2 changes: 2 additions & 0 deletions server/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# dependencies
/node_modules
5 changes: 3 additions & 2 deletions app.js → server/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ const cors = require('cors');
const morgan = require('morgan');
const path = require('path');

const router = require('./api/router');
const router = require('./router');

const app = express();

app.set('port', process.env.PORT || 3001);

if (process.env.NODE_ENV === 'production') {
app.use(express.static(path.join(__dirname, 'client/build')));
app.use(express.static(path.join(__dirname, '../client/build')));
}

mongoose.Promise = global.Promise;
Expand All @@ -24,6 +24,7 @@ if (process.env.NODE_ENV !== 'production') {
app.use(morgan('combined'));
app.use(cors());
app.use(bodyParser.json({ type: '*/*' }));
app.use(bodyParser.urlencoded({ extended: false }));

router(app);

Expand Down
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.
21 changes: 21 additions & 0 deletions server/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "server",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"dependencies": {
"bcrypt-nodejs": "^0.0.3",
"body-parser": "^1.17.1",
"cors": "^2.8.3",
"express": "^4.15.2",
"jwt-simple": "^0.5.1",
"mongoose": "^4.9.2",
"morgan": "^1.8.1",
"passport": "^0.3.2",
"passport-jwt": "^2.2.1",
"passport-local": "^1.0.0"
},
"scripts": {
"start": "nodemon server.js"
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit df47040

Please sign in to comment.