some api calls functioning as intended
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
const passportLoader = require('./passport');
|
||||
const expressLoader = require('./express');
|
||||
const routes = require('../routes/API');
|
||||
const swagger = require('./swagger');
|
||||
|
||||
module.exports = async (app) => {
|
||||
const express = await expressLoader(app);
|
||||
const passport = await passportLoader(express);
|
||||
await routes(app, passport);
|
||||
await swagger(app);
|
||||
|
||||
console.log('loaders called');
|
||||
}
|
||||
@@ -4,7 +4,7 @@ const LocalStrategy = require('passport-local').Strategy;
|
||||
const AuthService = require('../services/AuthService');
|
||||
const AuthInstance = new AuthService();
|
||||
|
||||
module.exports = (app) => {
|
||||
module.exports = async (app) => {
|
||||
app.use(passport.initialize());
|
||||
app.use(passport.session());
|
||||
|
||||
|
||||
@@ -4,8 +4,8 @@ const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
// Loading via yml.safeLoad to avoid errors with special characters during processing
|
||||
const swaggerDocument = yaml.safeLoad(fs.readFileSync(path.resolve(__dirname, '../swagger.yml'), 'utf8'));
|
||||
const swaggerDocument = yaml.load(fs.readFileSync(path.resolve(__dirname, '../swagger.yml'), 'utf8'));
|
||||
|
||||
const app = require('../server');
|
||||
|
||||
app.use('/api-docs', swaggerUI.serve, swaggerUI.setup(swaggerDocument));
|
||||
module.exports = async (app) => {
|
||||
app.use('/api-docs', swaggerUI.serve, swaggerUI.setup(swaggerDocument));
|
||||
}
|
||||
Reference in New Issue
Block a user