Files
demo/server.js
2023-07-25 10:42:45 +07:00

23 lines
619 B
JavaScript
Raw 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 app = express();
const corsOptions = {
origin: "http://localhost:3000"
};
app.use(cors(corsOptions));
app.use(express.json());
app.use(express.urlencoded({extended: true}));
const db = require("./app/models");
db.sequelize.sync();
require('./app/controllers/auth.routes')(app);
require('./app/controllers/user.routes')(app);
const PORT = 8080;
app.listen(PORT, () => {
console.log(`Сервер значится запустился на порту ${PORT}. Ну это значит, что это вроде работает.`);
});