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

Add an example project for a basic http server built with just node #25

Merged
merged 30 commits into from
Sep 28, 2019

Conversation

silwalanish
Copy link
Member

@silwalanish silwalanish commented Sep 27, 2019

Resolves #20

Description

  • Add an example project for a basic http server built with just node
    1. Log info/debug/error with a unique request id prepended.

Test

$ curl 'http://localhost:8000?a=20&b=30' && curl 'http://localhost:8000?a=10&b=50' && curl 'http://localhost:8000?a=50&b=100'

Output

[ DEBUG ] [ acd04c5b ] Received a: 20
[ DEBUG ] [ acd04c5b ] Received b: 30
[ INFO  ] [ acd04c5b ] Simulating delay
[ DEBUG ] [ acd04c5b ] Calculated sum: 50
[ DEBUG ] [ ece2ec66 ] Received a: 10
[ DEBUG ] [ ece2ec66 ] Received b: 50
[ INFO  ] [ ece2ec66 ] Simulating delay
[ DEBUG ] [ ece2ec66 ] Calculated sum: 60
[ DEBUG ] [ 0964953f ] Received a: 50
[ DEBUG ] [ 0964953f ] Received b: 100
[ INFO  ] [ 0964953f ] Simulating delay
[ DEBUG ] [ 0964953f ] Calculated sum: 150
[ INFO  ] [ acd04c5b ] Delay end
[ INFO  ] [ ece2ec66 ] Delay end
[ INFO  ] [ 0964953f ] Delay end

@codecov-io
Copy link

codecov-io commented Sep 27, 2019

Codecov Report

Merging #25 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff           @@
##           master     #25   +/-   ##
======================================
  Coverage    69.1%   69.1%           
======================================
  Files           5       5           
  Lines         123     123           
  Branches       19      19           
======================================
  Hits           85      85           
  Misses         31      31           
  Partials        7       7

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e899695...71e79d3. Read the comment docs.

@silwalanish
Copy link
Member Author

@kabirbaidhya please review.

@kabirbaidhya
Copy link
Contributor

@silwalanish You can also make it similar to this - https://github.com/leapfrogtechnology/async-store/tree/master/examples/express-ts/src. Just don't use express that's all.

@silwalanish
Copy link
Member Author

@silwalanish You can also make it similar to this - https://github.com/leapfrogtechnology/async-store/tree/master/examples/express-ts/src. Just don't use express that's all.

Done

@kabirbaidhya kabirbaidhya merged commit 9ab6969 into leapfrogtechnology:master Sep 28, 2019
@silwalanish silwalanish deleted the add-example-node branch September 30, 2019 05:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add an example project for a basic http server built with just node
3 participants