implemented data initializer

This commit is contained in:
X4Lo committed 2024-04-21 16:03:16 +01:00
1 parent a750ad16a3
commit 883d899380
2 files changed
+67 -1

No files matched your search

+4 -1
View File
@@ -29,13 +29,16 @@ app.use((req, res, next) => {
app.use('/api/v1', routes);
// Start the server
const relations = require('./db/relations.js')
const relations = require('./db/relations.js');
const { initializeGenres, initializeData } = require('./db/dataInitializer.js');
sequelize
// .sync({force: true}) // will drop all tables and recreate them.
// .sync({ alter: true }) // will attempt to automatically alter tables to fit the model definitions.
.sync()
.then((result) => {
initializeData();
app.listen(PORT, () => {
//const Entry = require("./models/Entry.js")
console.log(`Backend server running on http://localhost:${PORT}`);