mirror of
https://github.com/sasjs/server.git
synced 2025-12-10 19:34:34 +00:00
20 lines
491 B
TypeScript
20 lines
491 B
TypeScript
import { Express } from 'express'
|
|
|
|
import webRouter from './web'
|
|
import apiRouter from './api'
|
|
import appStreamRouter from './appStream'
|
|
|
|
import { csrfProtection } from '../middlewares'
|
|
|
|
export const setupRoutes = (app: Express) => {
|
|
app.use('/SASjsApi', apiRouter)
|
|
|
|
app.use('/AppStream', csrfProtection, function (req, res, next) {
|
|
// this needs to be a function to hook on
|
|
// whatever the current router is
|
|
appStreamRouter(req, res, next)
|
|
})
|
|
|
|
app.use('/', webRouter)
|
|
}
|