Tried adding API-backend
This commit is contained in:
20
api-backend/src/index.ts
Normal file
20
api-backend/src/index.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import * as express from 'express';
|
||||
import pathRoutes from './routes/parkRoutes';
|
||||
import coasterRoutes from './routes/coasterRoutes';
|
||||
|
||||
const app = express();
|
||||
const port = 3000;
|
||||
|
||||
// Middleware für JSON-Anfragen
|
||||
app.use(express.json());
|
||||
|
||||
// Routen hinzufügen
|
||||
app.use('/api/parks', pathRoutes);
|
||||
app.use('/api/coasters', coasterRoutes);
|
||||
|
||||
// Start des Servers
|
||||
app.listen(port, () => {
|
||||
console.log(`Server läuft auf http://localhost:${port}`);
|
||||
});
|
||||
|
||||
export default app;
|
||||
Reference in New Issue
Block a user