app.js
366 Bytes
const express = require('express');
const app = express()
const port = 3000;
app.get('/', (req, res) => {
res.send("hi");
})
app.get('/time', (req, res) => {
const time = new Date();
res.send(time);
})
app.get('/query', (req, res) => {
res.send(req.query.id)
})
app.listen(port, () => {
console.log("express server services on port 3000")
})