forked from AHRQ-CDS/AHRQ-CDS-Connect-Authoring-Tool
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathroutes.js
46 lines (35 loc) · 1.48 KB
/
routes.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
const artifactRouter = require('./routers/artifactRouter.js');
const testingRouter = require('./routers/testingRouter.js');
const externalCQLRouter = require('./routers/externalCQLRouter.js');
const configRouter = require('./routers/configRouter.js');
const cqlRouter = require('./routers/cqlRouter');
const authRouter = require('./routers/authRouter.js');
const repository = require('./routers/repository');
const fhirRouter = require('./routers/fhirRouter');
const foreseeHandler = require('./handlers/foreseeHandler');
module.exports = (app) => {
// Routing for API check
app.get('/', (req, res) => {
res.json({ message: 'API Initialized!' });
});
// Routing for Artifacts
app.use('/authoring/api/artifacts', artifactRouter);
// Routing for Testing
app.use('/authoring/api/testing', testingRouter);
// Routing for External CQL
app.use('/authoring/api/externalCQL', externalCQLRouter);
// Routing for Resources, ValueSets, Templates
app.use('/authoring/api/config', configRouter);
// Routing for cql files
app.use('/authoring/api/cql', cqlRouter);
// Routing for Auth
app.use('/authoring/api/auth', authRouter);
// Routing for repository
app.use('/authoring/api/repository', repository);
// Routing for FHIR VSAC endpoint
app.use('/authoring/api/fhir', fhirRouter);
// Handling for ForeSee script
app.get('/authoring/api/foresee.js', foreseeHandler);
// Catch all other Api calls
app.get('/authoring/api/*', (req, res) => { res.sendStatus(404); });
};