javascript
Published on January 26, 2024By DeveloperBreeze
// Import 'express' module
const express = require('express');
const app = express();
// Define a route for accessing a resource
app.get('/api/resource', (req, res) => {
res.json({ message: 'Resource data' });
});
// Start the server and listen on port 3000
app.listen(3000, () => {
console.log('RESTful API is running on port 3000');
});
Comments
Please log in to leave a comment.