Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Config node #1

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
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
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
16.15.0
2 changes: 0 additions & 2 deletions api/.eslintignore

This file was deleted.

47 changes: 0 additions & 47 deletions api/.eslintrc

This file was deleted.

4 changes: 2 additions & 2 deletions api/api/controllers/v0/account/account.controller.test.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
const supertest = require('supertest');
const { mongoose, AccountModel } = require('node-mongoose-models');
const testDB = require('../../../../test/test-db')(mongoose);
const { verifyToken, signToken } = require('../../../../components/auth/auth.service');
const { verifyToken, signToken } = require('../../../../src/components/auth/auth.service');
const requestLogin = require('../../../../test/request-login');
const app = require('../../../../index');
const { userErrors } = require('../../../../errors');
const { userErrors } = require('../../../../src/errors');

const user1 = {
username: 'test',
Expand Down
4 changes: 2 additions & 2 deletions api/api/controllers/v0/account/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const { authMiddleware } = require('../../../../components/auth');
const errorHandler = require('../../../../components/error-handlers');
const { authMiddleware } = require('../../../../src/components/auth');
const errorHandler = require('../../../../src/components/error-handlers');

const AccountController = require('./account.controller');

Expand Down
2 changes: 1 addition & 1 deletion api/api/controllers/v0/example/example.controller.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const requestLogin = require('../../../../test/request-login');
const app = require('../../../../index');
const {
exampleErrors,
} = require('../../../../errors');
} = require('../../../../src/errors');

const exampleMock = {
myNumber: 2020,
Expand Down
4 changes: 2 additions & 2 deletions api/api/controllers/v0/example/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const { authMiddleware } = require('../../../../components/auth');
const errorHandler = require('../../../../components/error-handlers');
const { authMiddleware } = require('../../../../src/components/auth');
const errorHandler = require('../../../../src/components/error-handlers');

const ExampleController = require('./example.controller');

Expand Down
4 changes: 2 additions & 2 deletions api/api/services/account.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ const { AccountModel } = require('node-mongoose-models');
const { compare } = require('bcrypt');
const {
InvalidLogin, UserNotFound, UserExist, InvalidPassword,
} = require('../../errors/user.errors');
const { signToken } = require('../../components/auth/auth.service');
} = require('../../src/errors/user.errors');
const { signToken } = require('../../src/components/auth/auth.service');

/**
* Check user and password and return token
Expand Down
2 changes: 1 addition & 1 deletion api/api/validators/example/example.validator.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const { ExampleModel } = require('node-mongoose-models');
const { exampleErrors } = require('../../../errors');
const { exampleErrors } = require('../../../src/errors');

/**
* Check if id is valid
Expand Down
2 changes: 1 addition & 1 deletion api/bin/www
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
const http = require('http');

const app = require('..');
const config = require('../config');
const config = require('../src/config');

const port = process.env.PORT || config.port;

Expand Down
22 changes: 0 additions & 22 deletions api/components/auth/auth.service.js

This file was deleted.

7 changes: 0 additions & 7 deletions api/components/auth/index.js

This file was deleted.

27 changes: 0 additions & 27 deletions api/config/db.js

This file was deleted.

9 changes: 0 additions & 9 deletions api/config/express/body-parser.js

This file was deleted.

8 changes: 0 additions & 8 deletions api/config/express/cors.js

This file was deleted.

8 changes: 0 additions & 8 deletions api/config/express/helmet.js

This file was deleted.

9 changes: 0 additions & 9 deletions api/config/express/pre.js

This file was deleted.

7 changes: 0 additions & 7 deletions api/errors/index.js

This file was deleted.

9 changes: 0 additions & 9 deletions api/index.js

This file was deleted.

12 changes: 12 additions & 0 deletions api/nodemon.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"watch": [
"src"
],
"ignore": [
"src/**/*.test.ts",
"node_modules"
],
"ext": "ts,mjs,js,json,graphql",
"exec": "etsc && node ./dist/index.js",
"legacyWatch": true
}
Loading