Files
demo/server.js
2023-08-16 12:05:24 +07:00

23 lines
698 B
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

const express = require("express");
const cors = require("cors");
const config = require("./app/config/starting.config");
const app = express();
const corsOptions = {
origin: config.origin
};
app.use(cors(corsOptions));
app.use(express.json());
app.use(express.urlencoded({extended: true}));
const db = require("./app/models");
db.sequelize.sync({force: config.debug});
require('./app/controllers/auth.routes')(app);
require('./app/controllers/user.routes')(app);
module.exports = app.listen(config.port, () => {
console.log(`Сервер значится запустился на порту ${config.port}. Ну это значит, что это вроде работает.`);
});