Some changes
This commit is contained in:
@@ -7,8 +7,12 @@ import authRoutes from './routes/authRoutes.js';
|
||||
import clubRoutes from './routes/clubRoutes.js';
|
||||
import diaryRoutes from './routes/diaryRoutes.js';
|
||||
import memberRoutes from './routes/memberRoutes.js';
|
||||
import participantRoutes from './routes/participantRoutes.js';
|
||||
import activityRoutes from './routes/activityRoutes.js';
|
||||
import Member from './models/Member.js';
|
||||
import DiaryDate from './models/DiaryDates.js';
|
||||
import Participant from './models/Participant.js';
|
||||
import Activity from './models/Activity.js';
|
||||
|
||||
const app = express();
|
||||
const port = process.env.PORT || 3000;
|
||||
@@ -21,6 +25,8 @@ app.use('/api/auth', authRoutes);
|
||||
app.use('/api/clubs', clubRoutes);
|
||||
app.use('/api/clubmembers', memberRoutes);
|
||||
app.use('/api/diary', diaryRoutes);
|
||||
app.use('/api/participants', participantRoutes);
|
||||
app.use('/api/activities', activityRoutes);
|
||||
|
||||
app.use(express.static(path.join(__dirname, '../frontend/dist')));
|
||||
|
||||
@@ -31,12 +37,14 @@ app.get('*', (req, res) => {
|
||||
(async () => {
|
||||
try {
|
||||
await sequelize.authenticate();
|
||||
await User.sync({ alter: true });
|
||||
await Club.sync({ alter: true });
|
||||
await UserClub.sync({ alter: true });
|
||||
await Log.sync({ alter: true });
|
||||
await User.sync({ alter: true });
|
||||
await Club.sync({ alter: true });
|
||||
await UserClub.sync({ alter: true });
|
||||
await Log.sync({ alter: true });
|
||||
await Member.sync({ alter: true });
|
||||
await DiaryDate.sync({ alter: true });
|
||||
await Participant.sync({ alter: true });
|
||||
await Activity.sync({ alter: true });
|
||||
app.listen(port, () => {
|
||||
console.log(`Server is running on http://localhost:${port}`);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user