Files
demo/server.js
dmitrium12 a059bcb196 первый коммит, надеюсь последний.
Сделанно:
1. минимально рабочий бэк
2. 2 модели
3. 1 миграция
2023-07-09 17:35:12 +07:00

23 lines
611 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/routers/auth.routes')(app);
require('./app/routers/user.routes')(app);
const PORT = 8080;
app.listen(PORT, () => {
console.log(`Сервер значится запустился на порту ${PORT}. Ну это значит, что это вроде работает.`);
});