Skip to content

style: make code more readable#6

Open
spb-superstruct wants to merge 1 commit intomasterfrom
style/follow-JSSS
Open

style: make code more readable#6
spb-superstruct wants to merge 1 commit intomasterfrom
style/follow-JSSS

Conversation

@spb-superstruct
Copy link
Copy Markdown
Contributor

closes #5

@superstruct-bot
Copy link
Copy Markdown
Contributor

Provide a descriptive title to your PR. The title should describe what changes your PR introduces. In the description, you could tell more about what exactly was changed in code style.

Comment on lines -8 to +9
if (req.url === "/user-agent") return respondU(req, res);
if (req.url.match(/^\/b64\//)) return respondB(req, res);
if (req.url === '/') return respondHello(req, res)
if (req.url === '/user-agent') return respondUserAgent(req, res)
if (req.url.match(/^\/b64\//)) return respondBase64(req, res)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The refactoring should be in a separate PR.

function respondU(req, res) {
const ua = req.headers["user-agent"];
res.end(JSON.stringify({ ua }));
function respondUserAgent (req, res) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This PR should include only code that contributes towards the style changes. You mixed style changes and refactoring (functions' names changes).

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.

Code in server.js and test.js doesn't follow JS Standard Style

2 participants