-
Notifications
You must be signed in to change notification settings - Fork 177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
the task was done #56
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost done) Let's improve
|
||
const PORT = 8080; | ||
|
||
const server = http.createServer((req, res) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The server does not provide a way for the user to select a compression type. The Brotli compression is used by default.
src/index.js
Outdated
|
||
const http = require('http'); | ||
const fs = require('fs'); | ||
const zlip = require('zlib'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a typo in the require statement for 'zlib'. It should be 'zlib' not 'zlip'.
src/index.js
Outdated
pipeline(fileStream, brotli, res, (error) => { | ||
if (error) { | ||
res.statusCode = 500; | ||
res.setHeader('Content-Type', 'text/plain'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The 'Content-Type' header is set to 'text/plain' in case of an error. Consider using 'text/html' or 'application/json' for a more structured error message.
src/index.js
Outdated
const path = require('path'); | ||
const { pipeline } = require('stream'); | ||
|
||
const PORT = 8080; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move PORT
to env file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job!!!
No description provided.