NodeJS Slip 11A solution

//Slip_11A.js

const express = require('express');
const app = express();
const port = 3000;

// College information
const collegeInfo = {
name: 'PCCCS',
location: 'CHINCHWAD',
founded: 2000,
departments: ['Computer Science', 'BBA', 'COMMERCE'],
};

// Serve college information
app.get('/college', (req, res) => {
res.json(collegeInfo);
});

app.listen(port, () => {
console.log('Server is running at http://localhost:${port}');
});

No comments:

Post a Comment