DEV Community

Cover image for How you can build your own web framework for Node.js

How you can build your own web framework for Node.js

Chris Noring on June 25, 2020

Follow me on Twitter, happy to take your suggestions on topics or improvements /Chris TLDR; this article teaches you to implement the framework Ex...
Collapse
 
vinaykevadia profile image
Vinay Kevadiya

Nice article Chris, I have release opensource fullstack framework for rapid SaaS application development: OreactJS.
Here is the documentation link: oreactjs.com
Feel free to contribute in development.

Collapse
 
erichstark profile image
Erich Stark

Your url is not working.

Collapse
 
nibble profile image
Joseph Mawa • Edited

Thanks for the article. I am yet to understand most of the things you talked about. This particular one in the introduction left me a little confused.

Given a URL looking like so /products?page=1&pagesize=20, the query parameters are everything that happens after ?.

What about query string? I have always thought page=1 is a paramter-value pair. When you combine parameter-value pairs after the ?, you make up query string. Can i use the terms query string and query parameters interchangeably to mean the same thing?

EDIT:
I am still a newbie.

Collapse
 
softchris profile image
Chris Noring

query string is the full string ?page=1&pagesize=20. A query parameter is just one of the values like page. Query parameters are just a term to say all the parameters, in that I guess it's synonymous to query string. I'm using this terminology parameters as we also have other types of parameters, like route parameters.. If it helps, if someone says query string they mean this ?page=1&pagesize=20. If someone says query parameters they most likely want to parse the query string to something like this { page: '1', pageSize: '10' } so it can be used to filter a response. I think of a URL like this http://localhost:3000/products/<route parameter>?queryParameter=value&anotherQueryParameter=value.

Collapse
 
nibble profile image
Joseph Mawa

Thanks for the quick response. I guess i am just overthinking things.

Collapse
 
taslangraham profile image
Taslan Graham

Awesome article Chris! Enojoyed it.
I have created a CLI, Tode-CLI, for scaffolding Node APIs. It leverages express.js to handle routing.
Here's a link to read more about it - npmjs.com/package/tode-cli
Dev.to article talking Tode-CLI - dev.to/taslangraham/side-project-t...

Collapse
 
tareksalem profile image
tareksalem • Edited

Did you try grandjs for solid server side nodejs apps?
grandjs.netlify.app

Collapse
 
softchris profile image
Chris Noring

never heard of until now.. Makes me think of Nest, thanks for the link

Collapse
 
tareksalem profile image
tareksalem

It has lot of features rather than nest

Collapse
 
shaijut profile image
Shaiju T

Questions on Node.js:

  • Is Node.js secure to use as web server compared to IIS web server ?

  • Do we need to set up more configuration to use Node.js as web server in Production ?

Collapse
 
softchris profile image
Chris Noring

Node.js is a runtime. There are many great web frameworks Express, Koa, Hapi, Fastify, Nest. Most people host their apps in the Cloud nowadays like Heroku, Azure, AWS. They are secure to a point. You still need to write secure code and care about handling auth in a good way, like with JWT for example. There are still issues like Cross-site request forgery for example that you need to handle regardless if you go with .NET or Node or some other runtime. As for running Node.js in production, here's a great article by my colleague Burke freecodecamp.org/news/you-should-n...

Collapse
 
shaijut profile image
Shaiju T

😄, Nice, Would like to know why you like writing more articles instead of Just recording a single video and upload in youtube ?

Collapse
 
softchris profile image
Chris Noring

I like doing both. Videos are more effort for me (creating a powerpoint deck, think out the structure, retakes because sound disturbances etc) so I do it a little more seldom.

Collapse
 
shaijut profile image
Shaiju T • Edited

I like few thinks about articles:

  • It can be read easily again and again to understand but in video i have to rewind again and again.
  • It has more content
  • The code can copied to try out fast.
Collapse
 
jaydadarkar profile image
Jay Dadarkar

Have made something out of express...
npmjs.com/@jaydadarkar/nitromvc