Skip to content
Snippets Groups Projects
Commit 993faae2 authored by Oshani Weerakoon's avatar Oshani Weerakoon
Browse files

practise 2 exercise

parent ea6338c6
Branches
Tags
No related merge requests found
Code Examples/Ex 2/Response Header.png

244 KiB

const express = require('express');
const compression = require('compression');
const app = express();
// Use compression middleware
app.use(compression());
app.get('/', (req, res) => {
const largeData = Array(500000).fill("This is a repetitive string to simulate large data. ").join('');
res.send(largeData);
});
const PORT = 3000;
app.listen(PORT, () => {
console.log(`Server is running on http://localhost:${PORT}`);
});
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment