How to Learn ExpressJS? [closed] - node.js

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
Is it possible to learn ExpressJS without much prior knowledge of Node.js?
Is this a good approach? If yes, what resources can you recommend that I use to learn Express?

Yes of course, it's possible to learn expressJS without NodeJS. Even if it's always better to know both.
The best way to learn expressJS is the official guide :
http://expressjs.com

It is not a good idea to try to use Express before learning node.js basics. You really do need to understand the fundamentals of async because the node.js library modules are all async.
However, it shouldn't require more than a couple of days of studying some of the node.js tutorials and exploring modules like Promises and Steps.

Simple answer is yes, but it's not recommended, you can learn more about Express on their site.
Why is this not a good idea, well simply becuase nodeJS has programming standards, where you have to learn about the Disk I/O and cycle counts before you dive into coding, the reason for this is Node is designed to be Non-Blocking meaning that every action you perform in node that requires the disk to spin up or network access requires it to be compliant with its event structure.
For example:
require('http').createServer(function(Request, Response){
/*
* If your code here is blocking every request that comes in to the server get's bottlenecked.
*/
});
Because if this reason alone i would start on the video presentations around the net to start getting an understanding, and then hit the Node API before you attempt to create anything in node.
Why do you not wish to learn Node before you attempt to learn a module for node?
What I also advise is for you to get a IRC Chat and visit the #node.js channel as the guys over there will help you immensely.

Related

Is it a bad idea to start to write a microservices NodeJS backend application in REST, then try to convert/wrap some/whole parts with gRPC or GraphQL? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 3 months ago.
Improve this question
Is it a wrong manner to start writing a NodeJS application using REST architecture, then try to use GraphQL or gRPC approaches in some parts or completely rewrite some or whole the application in the future?
The reason for doing this is previous experience and coding speed in REST APIs. But at the other hand it's kinda a big microservices project and should support millions of users.
GraphQL is not going to help you scale, quite the opposite in many cases. GraphQL is an optimization (in some cases) but mostly for developer productivity, but there is a complexity cost.
Generally I would suggest to steer away from this optimization unless you have a clear understanding of what you're solving for. REST is a good 'default choice' because it's well understood, requires little tooling and is pretty universal.
Once you are further into your project and you find that you have (ideally measurable) challenges, you're in a much better place to decide to use a more specialized paradigm (gRPC/graphql) and why, but it doesn't sound like you're there yet.

Which will be better for API creation - RESTify or KOA.js [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 5 years ago.
Improve this question
I am trying to create a REST service for an iOS application.
I am debating to which framework should I use (as I am also a bit new to Node.js).
I started by considering the following - Express, HAPI, RESTify, KOA.js (using KOALA maybe?) and ended up by debating between RESTify (because it seems to be really easy for creating API) and KOA.js (because it is the new standard which will replace Express)..
also I saw the spike of popularity KOA.js was given recently..
Can someone give me the answer to which will be better for me?
It depends on your specific needs.
KOA comes all the way from Express, and is empowered by ES6 generator, all of which makes it super concise and, as I say, more right.
RESTify is based on Express and is more mature at what it is designed to do: Constructing REST API.
I will be using KOA for a personal project, and be using RESTify at work for a job that must be done right now.
You can also take a look at fortune.js,
It's a great start if you want to integrate json api especially if your client use ember.js.
Another popular solution is loopback.io that allow you to quickly develop and test your api with swagger and cli tools for quick generation.
I suggest Koa because it has better error-handling and stream-handling than express. Koa middleware is much simpler and less hacky than Express middleware due to the way middleware flows in a stack-like manner.
see this blog when you have 10000 request, koa performs better than express: https://www.appneta.com/blog/basic-performance-comparison-between-koa-and-express/

Is it best to use Node.js or SignalR [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
At the risk of this question being closed I will ask anyway.
I have been looking at the different JavaScript Frameworks as most jobs roles seem to want:
angular.js
Knockout.js
Node.js
Whilst i can see Angualr.js and Knockout.js provides a MVC construct to the markup pages (though still not sure which one is best to use) I cannot see what is the case for node.js?
Whilst I appreciate node.js is good for real-time comms but so is Signalr as they both use long-polling.
At present I use signalr to update images on my clients.
is there any purpose to swapping this out for node.js?
Like I said this question could be voted to be closed as it may seem to be asking an opinion - and that would be an answer to me in itself as it would be down to developer choice but is there a DEFINITIVE reason to use node.js over signalr?
thanks
One reason to use node.js is code redundancy. Both the server and client run the same language, thus they may share a certain part of the codebase, meaning potentially less to write. With libraries like Browserify this process can be made a lot more transparent and writing the client-side can be almost indistinguishable from server-side development. Another opportunity this opens up is both client and server side rendering + MVC setups with, for example, rendr.js. So you can have both the fast load speeds of server-side and responsiveness of client-side rendering. If any of this will be useful naturally depends on what you are developing.

How to develop a simple webpage for a CLI Node.js script [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I have a Node.js script running locally through command line (I haven't developed it so not very familiar with the code) which takes an email address as a parameter and looks up some data and spits out results in a command line table.
I wanted to make a "front-end" for this, like a simple local Webpage where I could punch in an email address and see the response right on the browser itself.
I am not very familiar where to get started without complicating this into a bigger problem than it is. Any guidance would be very helpful here. I haven't really done any web development using Node or JS before but I am familiar with basic web development (and willing to learn) new ways of doing things.
If I can provide any additional information please let me know.
Thank you!
The most prominent framework for developing node apps is express.js. You can't go wrong if you invest some effort into learning express. It will help you with routing and templates, and can generate a skeleton application for you. Read through the guide, and learn:
http://expressjs.com/guide.html
Also you may study the answer to the most popular node question on this site:
How do I get started with Node.js

A few questions about node.js [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
Am I right in thinking that node.js is a "total" development platform, in much the same way as asp.NET, PHP and even classic ASP are?
There seems to be a lot of excitement about node.js which makes me a little nervious about it being yet another "flash in the pan" type technology that will fade away?
If I was going to go about learning node.js have you got any tips how I might start out, without frying my brian?
Node.js is not a platform for common applications like blogs, etc.
It's for fast async apps like chats, relays, etc
It can be compared to Twisted framework (Python), Tornado framework (Python) or eventmachine framework (Ruby).
As said DmitryR, node.js is a framework of Javascript.
It is also based on the V8 engine of Chrome.
It is server side based, but can be used for non-internet application too (I m develloping one right now).
What is your goal in learning Node.js?
Create a website
Wrong choice
Create a web app (like a chat)
Good choice
Learning a new language ''for fun''
Good choice too, Node.js is asynchronous and quite easy to learn, even with obscure docs, and can be used for a lot of things. It is also a script, so it don t require to be compiled, but you better be on non-windows os, since node.js for windows can be a pain for devellopement.
If you want tips about where to start, you d better start by understanding asynchronous programming, it s the only "hard" part of this language.
There are some interactive ways to learn node.js like:
nodeschool
node.codeschool
You can give them a try.

Resources