add some changes
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
32c249e7b8
commit
8d8e205f94
@ -1,18 +1,24 @@
|
||||
import express from "express";
|
||||
import cors from "cors";
|
||||
import { IngredientsController } from "./controllers/ingredients.controller";
|
||||
import { RecipesController } from "./controllers/recipes.controller";
|
||||
import { StepsController } from "./controllers/steps.controller";
|
||||
|
||||
const app = express();
|
||||
|
||||
// Configuration du middleware CORS pour autoriser toutes les origines
|
||||
app.use(cors({
|
||||
origin: '*',
|
||||
}));
|
||||
|
||||
app.get('/', (req, res) => {
|
||||
res.send('Hello from express and typescript !');
|
||||
res.json({ message: 'Hello from express and typescript!' });
|
||||
});
|
||||
|
||||
app.use('/ingredients', IngredientsController);
|
||||
app.use('/recipes', RecipesController);
|
||||
app.use('/steps', StepsController)
|
||||
app.use('/steps', StepsController);
|
||||
|
||||
const port = process.env.PORT || 3000;
|
||||
|
||||
app.listen(port, () => console.log(`App listenning on PORT ${port}`));
|
||||
app.listen(port, () => console.log(`App listening on PORT ${port}`));
|
||||
|
Loading…
Reference in new issue