Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

pushkarskiyrodion
Copy link

No description provided.

Copy link

@loralevitska loralevitska left a 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) => {

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');

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');

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;

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

Copy link

@maxim2310 maxim2310 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants