2024-10-26 05:31:22 +03:00
|
|
|
import express from 'express';
|
|
|
|
import UserRouter from './routers/user.js';
|
|
|
|
import GroupRouter from './routers/group.js';
|
2024-10-26 20:18:14 +03:00
|
|
|
import AbstractProductRouter from './routers/abstractproduct.js';
|
2024-10-26 05:31:22 +03:00
|
|
|
// import AdminRouter from './routers/admin.js';
|
|
|
|
import log from './utils/log.js'
|
|
|
|
|
|
|
|
import config from '../config.json' with {type: "json"};
|
|
|
|
|
|
|
|
const app = express();
|
|
|
|
|
|
|
|
app.use(express.urlencoded({extended: true}));
|
|
|
|
app.use(express.json());
|
|
|
|
app.use('/api/user/', UserRouter);
|
|
|
|
app.use('/api/group/', GroupRouter);
|
2024-10-26 20:18:14 +03:00
|
|
|
app.use('/api/abstractproduct', AbstractProductRouter);
|
2024-10-26 05:31:22 +03:00
|
|
|
// app.use('/api/admin/', AdminRouter);
|
|
|
|
|
|
|
|
app.listen(config.port, () => {
|
|
|
|
log.info(`Application has started on port ${config.port}`)
|
|
|
|
})
|