Posts CRUD

This commit is contained in:
2024-12-01 16:46:14 +00:00
parent 88e64e0885
commit bacb955108
2 changed files with 241 additions and 102 deletions

View File

@@ -8,6 +8,7 @@ import { fileURLToPath } from 'url';
import { dirname } from 'path';
import dotenv from 'dotenv';
import authRoutes from './routes/auth.js';
import postRoutes from './routes/posts.js';
// Load environment variables
dotenv.config();
@@ -45,11 +46,7 @@ await app.register(fastifyStatic, {
// Register routes
await app.register(authRoutes);
// Testing route
app.get('/', async (request, reply) => {
return { hello: 'world' }
});
await app.register(postRoutes);
// Start the server
const start = async () => {