This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Middleware = require('../middleware/JwtMiddleware'); | |
const Newsletter = require('../controllers/app/Newsletter'); | |
const Welcome = require('../controllers/Welcome'); | |
const Signup = require('../controllers/auth/Signup'); | |
const Login = require('../controllers/auth/Login'); | |
/** | |
* All the API endpoint or routes to mars is loaded here. You can load in routes from anywhere but it's best that you load them in from the controllers. | |
* | |
* @author Ilori Stephen <stephenilori458@gmail.com> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Jwt = require('jsonwebtoken'); | |
const CryptoJs = require('crypto-js'); | |
const Controller = require('../Controller'); | |
const UserModel = require('../../models/Users'); | |
/* Validators */ | |
const Validators = require('../../validators/Auth') | |
class Signup extends Controller { | |
constructor() { super(); } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Jwt = require('jsonwebtoken'); | |
const Controller = require('../Controller'); | |
const UserModel = require('../../models/Users'); | |
/* Validators */ | |
const Validators = require('../../validators/Auth') | |
class Login extends Controller { | |
constructor() { super(); } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3.9" | |
services: | |
martian_mongo_flavour: | |
build: . | |
env_file: | |
- .env.testing | |
links: | |
- martian_mongo_db | |
- martian_redis_db |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
events { worker_connections 1024; } | |
http { | |
#upstream servers | |
upstream martian_servers { | |
server martian_martian_mongo_flavour_1:4400; | |
server martian_martian_mongo_flavour_2:4400; | |
server martian_martian_mongo_flavour_3:4400; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM nginx:1.19.8-alpine | |
COPY ./nginx.conf /etc/nginx/nginx.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM node:15.12.0-alpine3.10 | |
WORKDIR /usr/src/app | |
COPY package*.json ./ | |
RUN npm install | |
COPY . . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Jwt = require('jsonwebtoken'); | |
const Controller = require('../Controller'); | |
const UserModel = require('../../models/Users'); | |
/* Validators */ | |
const Validators = require('../../validators/Auth') | |
class Login extends Controller { | |
constructor() { super(); } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const CryptoJs = require('crypto-js'); | |
const BaseValidator = require('./Validator'); | |
class Auth extends BaseValidator { | |
constructor() { super(); } | |
async login(Payload, Model) { | |
const Response = { status: false, errors: {} } | |
try { |