Added authGuard function and its implementations

Also refactored small code mistakes.
This commit is contained in:
Alexis
2021-01-19 18:52:52 +01:00
parent 410a58fc09
commit e8ca2416b7
31 changed files with 4062 additions and 3947 deletions

View File

@@ -19,10 +19,10 @@ const routes = require('./routes');
let app = express();
app.use(bodyParser.json({ limit: '10kb' }));
app.use(cors({
origin: [
"http://localhost:8080",
],
credentials: true,
origin: [
"http://localhost:8080",
],
credentials: true,
}));
app.use(morgan('dev'));
app.use(helmet());
@@ -31,7 +31,7 @@ app.use(helmet());
app.listen(port, () => console.log(`App listening on port ${port}`));
// Entry route
app.use('/api/v1/', routes.auth );
app.use('/api/v1/', routes.auth);
// Routing
app.use('/api/v1/spells', routes.spells);