Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
dist
node_modules
.vscode
.vscode
public
65 changes: 34 additions & 31 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,65 +29,68 @@
"test2": "jest --forceExit --verbose"
},
"dependencies": {
"@hapi/boom": "9.0.0",
"@hapi/joi": "17.1.0",
"@hapi/boom": "9.1.0",
"@hapi/joi": "17.1.1",
"app-root-path": "^3.0.0",
"bcryptjs": "2.4.3",
"body-parser": "1.19.0",
"celebrate": "11.0.1",
"celebrate": "12.0.1",
"chai": "^4.2.0",
"chalk": "3.0.0",
"compression": "1.7.4",
"cookie-parser": "1.4.4",
"cookie-parser": "1.4.5",
"cors": "2.8.5",
"dotenv": "^8.2.0",
"express": "4.17.1",
"express-basic-auth": "1.2.0",
"faker": "^4.1.0",
"helmet": "3.21.2",
"http-status": "1.4.0",
"helmet": "3.22.0",
"http-status": "1.4.2",
"jest": "^25.2.3",
"jsonwebtoken": "8.5.1",
"lodash": "4.17.15",
"mockgoose": "^8.0.4",
"mongoose": "5.7.7",
"moment": "^2.24.0",
"mongoose": "5.9.6",
"passport": "0.4.1",
"passport-cookie": "1.0.6",
"passport-jwt": "4.0.0",
"passport-local": "1.0.0",
"swagger-jsdoc": "3.4.0",
"swagger-ui-express": "4.1.2",
"ts-node": "^8.5.4",
"typescript": "3.7.2",
"uuid": "^3.4.0",
"chai": "^4.2.0",
"socket.io": "^2.3.0",
"supertest": "^4.0.2",
"jest": "^25.1.0"
"swagger-jsdoc": "4.0.0",
"swagger-ui-express": "4.1.4",
"ts-node": "^8.8.1",
"typescript": "3.8.3",
"uuid": "^7.0.2"
},
"devDependencies": {
"@types/app-root-path": "^1.2.4",
"@types/bcryptjs": "2.4.2",
"@types/chai": "^4.2.8",
"@types/compression": "1.0.1",
"@types/chai": "^4.2.11",
"@types/compression": "1.7.0",
"@types/cors": "2.8.6",
"@types/express": "4.17.2",
"@types/hapi__joi": "16.0.8",
"@types/express": "4.17.3",
"@types/hapi__joi": "16.0.12",
"@types/helmet": "0.0.45",
"@types/jest": "^25.1.1",
"@types/jest": "^25.1.4",
"@types/lodash": "4.14.149",
"@types/mongoose": "5.5.41",
"@types/node": "13.5.0",
"@types/passport": "1.0.2",
"@types/mongoose": "5.7.8",
"@types/node": "13.9.5",
"@types/passport": "1.0.3",
"@types/passport-local": "1.0.33",
"@types/socket.io": "^2.1.4",
"@types/supertest": "^2.0.8",
"@types/swagger-jsdoc": "3.0.2",
"@types/swagger-ui-express": "4.1.1",
"@types/uuid": "^3.4.7",
"@typescript-eslint/eslint-plugin": "2.11.0",
"@typescript-eslint/parser": "2.11.0",
"eslint": "6.7.2",
"eslint-config-prettier": "6.7.0",
"eslint-plugin-prettier": "3.1.1",
"@types/swagger-ui-express": "4.1.2",
"@types/uuid": "^7.0.2",
"@typescript-eslint/eslint-plugin": "2.25.0",
"@typescript-eslint/parser": "2.25.0",
"eslint": "6.8.0",
"eslint-config-prettier": "6.10.1",
"eslint-plugin-prettier": "3.1.2",
"nodemon": "^2.0.2",
"prettier": "1.19.1",
"ts-jest": "^25.1.0"
"prettier": "2.0.2",
"ts-jest": "^25.2.1"
}
}
2 changes: 1 addition & 1 deletion src/data/models/user.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ UserSchema.methods = {
* @return {Boolean}
* @api public
*/
comparePassword: async function(
comparePassword: async function (
candidatePassword: string
): Promise<boolean> {
return bcrypt.compare(candidatePassword, this.password);
Expand Down
16 changes: 10 additions & 6 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@ import mongoose from 'mongoose';
import config from './config/config';
import app from './config/express';

mongoose.connect(config.MONGO_DB_HOST as string, {
useNewUrlParser: true,
useUnifiedTopology: true,
useCreateIndex: true,
useFindAndModify: true
});
mongoose
.connect(config.MONGO_DB_HOST as string, {
useNewUrlParser: true,
useUnifiedTopology: true,
useCreateIndex: true,
useFindAndModify: true
})
.catch((e) => {
console.log('mongo connection failed');
});

app.listen(config.PORT, () => {
console.log(
Expand Down
4 changes: 1 addition & 3 deletions test/api/controllers/users/user.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import app from '../../../../src';

describe('Users API', () => {
it('GET / get all users', async () => {
return request(app)
.get(`/api/v1/users`)
.expect(200);
return request(app).get(`/api/v1/users`).expect(200);
});
});
Loading