| Level Navigation: 1 | 2 | 3 | (4ℹ️) | (5ℹ️) | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14⚡ | 15⚡ | (16ℹ️) | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26⚡ | 27⚡ | 28⚡ | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39⚡ | 40⚡ |
Deploy your Express server to Render so it’s accessible on the internet. This allows you to share your API with others and test it from anywhere.
Setup:
npm install (or leave default)npm start (make sure your package.json has a start script)PORT environment variable:
// src/index.js
import app from './app.js';
// Use Render's PORT environment variable, or default to 3000 for local development
const PORT = process.env.PORT || 3000;
app.listen(PORT, () => {
console.log(`Server running on port ${PORT}`);
});
Note: Since you’ve already refactored your app in Level 31, your src/index.js should already have the PORT setup. Just make sure it uses process.env.PORT || 3000 so Render can set the port dynamically.
https://your-app.onrender.com)Success Criteria: