Skip to content

Commit

Permalink
Merge branch 'master' of github.com:yalla-coop/rent-check into 18-sup…
Browse files Browse the repository at this point in the history
…eruser-manage-data
  • Loading branch information
amusameh committed Oct 24, 2019
2 parents 0636488 + 48cf988 commit 0fa9854
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 17 deletions.
8 changes: 2 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,19 @@
language: node_js
node_js:
- "10.5.0"
- "12.13.0"
cache:
directories:
- "node_modules"

env:
- MONGODB=4.0.0

before_install:
- sudo apt-get install libcairo2-dev libjpeg8-dev libpango1.0-dev libgif-dev
build-essential g++

install:
- wget http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-${MONGODB}.tgz
- tar xzf mongodb-linux-x86_64-${MONGODB}.tgz
- ${PWD}/mongodb-linux-x86_64-${MONGODB}/bin/mongod --version
- mongo --version
- npm run init
- npm i && npm run init

before_script:
- mkdir ${PWD}/mongodb-linux-x86_64-${MONGODB}/data
Expand Down
10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@
"test-coverage:client": "npm run test:coverage --prefix client",
"test-coverage:server": "npm run test:coverage --prefix server",
"coverage": "codecov",
"start": "run-p start:**",
"start:server": "npm start --prefix server",
"start:client": "npm start --prefix client",
"build": "npm run build --prefix client"
"dev": "run-p dev:**",
"dev:server": "npm start --prefix server",
"dev:client": "npm start --prefix client",
"start": "node server/bin/app",
"build": "npm run build --prefix client",
"heroku-prebuild": "npm i && npm run init && npm run database:build:production --prefix server"
},
"repository": {
"type": "git",
Expand Down
3 changes: 1 addition & 2 deletions server/bin/app
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@

// Pass configuration to application
require('../')({
port: 8000,
host: 'localhost'
port: process.env.PORT || 8000
})
6 changes: 2 additions & 4 deletions server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ module.exports = function main(options, cb) {
.catch(e => console.error(e));

// Start server
server = app.listen(opts.port, opts.host, function(err) {
server = app.listen(opts.port, function(err) {
if (err) {
return ready(err, app, server);
}
Expand All @@ -104,9 +104,7 @@ module.exports = function main(options, cb) {

serverStarted = true;
const addr = server.address();
logger.info(
`Started at ${opts.host || addr.host || "localhost"}:${addr.port}`
);
logger.info(`Listening on port ${addr.port}`);
ready(err, app, server);
});
};
3 changes: 2 additions & 1 deletion server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"scripts": {
"start": "nodemon ./bin/app",
"database:run:dev": "docker run -d -p 27017-27019:27017-27019 --name rentCheckMongo mongo",
"database:build:dev": "babel-node ./database/data",
"database:build:dev": "node ./database/data",
"database:build:production": "node ./database/data/index.js",
"database:build:fake": "babel-node ./database/data && npm run fake",
"fake": "babel-node ./database/data/fakedata",
"test": "jest --runInBand --detectOpenHandles --forceExit --watch",
Expand Down

0 comments on commit 0fa9854

Please sign in to comment.