24 lines
788 B
JavaScript
24 lines
788 B
JavaScript
import express from 'express';
|
|
import UserRouter from './routers/user.js';
|
|
import GroupRouter from './routers/group.js';
|
|
import AbstractProductRouter from './routers/abstractproduct.js';
|
|
import log from './utils/log.js'
|
|
|
|
import config from '../config.json' with {type: "json"};
|
|
import ProductRouter from './routers/product.js';
|
|
import CategoryRouter from './routers/category.js';
|
|
|
|
const app = express();
|
|
|
|
app.use(express.urlencoded({ extended: true }));
|
|
app.use(express.json());
|
|
|
|
app.use('/api/user/', UserRouter);
|
|
app.use('/api/group/', GroupRouter);
|
|
app.use('/api/abstractproduct', AbstractProductRouter);
|
|
app.use('/api/product', ProductRouter);
|
|
app.use('/api/category', CategoryRouter);
|
|
|
|
app.listen(config.port, () => {
|
|
log.info(`Application has started on port ${config.port}`)
|
|
}) |