You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
369 B
18 lines
369 B
import cors from 'cors'; |
|
import express from 'express'; |
|
import path from 'path'; |
|
|
|
import API_ROOT_PATH from './lib/consts/API_ROOT_PATH'; |
|
|
|
import routes from './routes'; |
|
|
|
const app = express(); |
|
|
|
app.use(express.json()); |
|
app.use(cors()); |
|
|
|
Object.entries(routes).forEach(([route, router]) => { |
|
app.use(path.join(API_ROOT_PATH, route), router); |
|
}); |
|
|
|
export default app;
|
|
|