Skip to content

Commit

Permalink
Update server.js
Browse files Browse the repository at this point in the history
  • Loading branch information
RickyRAV committed Oct 15, 2023
1 parent d170fcb commit 9296f33
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));

0 comments on commit 9296f33

Please sign in to comment.