Fix API authentication and identity service updates
This commit is contained in:
@@ -2,6 +2,7 @@ import express from 'express';
|
||||
import cors from 'cors';
|
||||
import helmet from 'helmet';
|
||||
import { errorHandler } from './middleware/error';
|
||||
import { requireApiKey } from './middleware/auth';
|
||||
|
||||
// Import routers
|
||||
import identityRouter from './modules/identity/router';
|
||||
@@ -39,6 +40,9 @@ app.use((req, res, next) => {
|
||||
next();
|
||||
});
|
||||
|
||||
// Global API Key Check
|
||||
app.use(requireApiKey);
|
||||
|
||||
// API Routes
|
||||
app.use('/v1/auth', identityRouter);
|
||||
app.use('/v1', catalogueRouter);
|
||||
@@ -61,3 +65,4 @@ app.use(errorHandler);
|
||||
app.listen(PORT, () => {
|
||||
console.log(`Pharmacy Core API listening on port ${PORT}`);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user