diff --git a/server.js b/server.js index acb5c04..99d0165 100644 --- a/server.js +++ b/server.js @@ -6,3 +6,14 @@ app.use(express.json()); app.get('/', async (req, res) => { res.send('Welcome to the API!'); }); + + +const port = process.env.PORT || 3000; +const startServer = async () => { + + app.listen(port, () => { + console.log(`Server is running on http://localhost:${port}`); + }); +}; + +startServer().catch(e => console.error(e));