Skip to content

Commit

Permalink
Move files to server/src
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaconil committed Oct 4, 2017
1 parent 7172464 commit 7e0e034
Show file tree
Hide file tree
Showing 24 changed files with 127 additions and 145 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
node_modules
npm-debug.log
yarn-error.log
.node-version

public/*.min.*
Expand Down
1 change: 0 additions & 1 deletion .npmrc

This file was deleted.

4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ RUN yarn

COPY . .

RUN npm run webpack
RUN yarn run webpack

CMD [ "npm", "start" ]
CMD [ "yarn", "start" ]
2 changes: 1 addition & 1 deletion docker-compose.override.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ services:
volumes:
- .:/usr/src/app
- /usr/src/app/node_modules
command: npm run dev
command: yarn run dev
28 changes: 14 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@
"babel-preset-env": "^1.6.0",
"babel-preset-react": "^6.1.18",
"body-parser": "^1.14.1",
"boom": "5.2.0",
"boom": "6.0.0",
"classnames": "^2.1.3",
"css-loader": "0.28.7",
"dotenv": "4.0.0",
"extract-text-webpack-plugin": "3.0.0",
"file-loader": "0.11.2",
"file-loader": "1.1.4",
"hapi": "^16.0.0",
"hapi-auth-jwt2": "^7.0.0",
"hapi-boom-decorators": "3.0.0",
"history": "^3.0.0",
"inert": "^4.0.0",
"joi": "11.0.1",
"joi": "10.6.0",
"jsonwebtoken": "8.0.1",
"less": "^2.5.3",
"less-loader": "4.0.5",
Expand All @@ -40,35 +40,35 @@
"redux": "^3.0.4",
"redux-thunk": "^2.0.0",
"scroll": "2.0.1",
"style-loader": "0.18.2",
"style-loader": "0.19.0",
"superagent": "^3.1.0",
"url-loader": "^0.5.6",
"url-loader": "0.6.2",
"webpack": "3.6.0",
"winston": "^2.1.0"
},
"devDependencies": {
"chai": "4.1.2",
"david": "11.0.0",
"eslint": "4.7.0",
"eslint-plugin-react": "7.3.0",
"mocha": "3.5.3",
"eslint": "4.8.0",
"eslint-plugin-react": "7.4.0",
"mocha": "4.0.0",
"nodemon": "1.12.1",
"sinon": "3.2.1"
"sinon": "4.0.1"
},
"scripts": {
"start": "node server/app.js",
"start": "node server/src/app.js",
"webpack": "webpack",
"watch": "webpack --watch",
"lint": "eslint 'client/**/**/*.js' 'client/**/**/*.jsx' 'server/**/**/*.js' 'test/**/**/*.js' && david",
"test": "mocha test/**/*.test.js",
"lint": "eslint 'client/**/**/*.js' 'client/**/**/*.jsx' 'server/**/**/*.js' && david",
"test": "mocha server/test/**/*.test.js",
"dev": "webpack --watch --watch-poll & nodemon --watch server -L -x \"npm start\""
},
"main": "server/app.js",
"main": "server/src/app.js",
"repository": {
"type": "git",
"url": "[email protected]:Jaconil/journal.git"
},
"engines": {
"node": ">=6.0.0"
"node": ">=8.0.0"
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions server/api/index.js → server/src/api/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
'use strict';

module.exports = (logger, config, db) => {
const users = require('./users')(logger, config, db);
const days = require('./days')(logger, config, db);
const users = require('./users/index')(logger, config, db);
const days = require('./days/index')(logger, config, db);

const apiDefault = {
routes: [
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion server/hapi.js → server/src/hapi.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ module.exports = (logger, config, db) => {
verifyOptions: { algorithms: ['HS256'] }
});

const api = require('./api')(logger, config, db);
const api = require('./api/index')(logger, config, db);

server.method(_.map(api.handlers, (method, name) => ({ name, method })));
server.route(api.routes);
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 4 additions & 3 deletions test/server/server.test.js → server/test/server.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ describe('Server', () => {
const config = {
port: 8000,
jwtSecret: 'abc',
passwordSalt: 'salt'
passwordSalt: 'salt',
jwtDuration: 1800
};

const collections = {};
Expand All @@ -35,7 +36,7 @@ describe('Server', () => {
}
};

const hapi = require('../../server/hapi')(logger, config, db);
const hapi = require('../src/hapi')(logger, config, db);

const state = {
server: null,
Expand All @@ -51,6 +52,6 @@ describe('Server', () => {
require('./public')(state);

describe('/api', () => {
require('./api')(state);
require('./api/index')(state);
});
});
Loading

0 comments on commit 7e0e034

Please sign in to comment.