I've background in java swing programming with basic working knowledge of spring, javascript, angularjs, http.
I want to learn web server side programming using express js. Will i need to first learn nodejs and then be able to use expressjs or starting express js directly will be possible?
I'm planning on creating rest apis using express and then consuming them with angular js.
I will like to answer this question based on your past experience. Can you learn Java Swing framework without learning Java? No you can't. because you should understand concepts of Java to best use the Swing package. Similarly, you should understand the concepts of Javascript and Node.js to best understand Express Framework.
I would suggest you to start with a small project of setting up a server using express and node.js. And dig deep into node concepts whereever you face problems.
Related
Most books on Node.js have Express.js sections. Most Node tutorials I've seen are about web development with Node and Express. So, is the knowledge of Express required for a deep understanding of Node?
No, It isn't,
ExpressJs is framework build on top of nodejs, as they are many framework in different programming language it is the same for Javascript in the backend side.
Here is some of example of Framework
Loopback
Sails.js
Koa
Express
In the nodejs world ExpressJS is the popular one, so in many books it's normal to talk about It, as Javascript was firstly build for the web.
But NodeJS can be use for so many kind of application like
Data Streaming Apps
Server-Side Proxy
Big Data Analytics
Wireless Connectivity
System Monitoring Dashboard
Chatbots
And other many sort of application.
In the web world ExpressJS is the popular one.
So you don't have to learn ExpressJS to deep undestand nodejs. And you don't have to learn it if you would not build web application or API. You can also rely packages shiped with nodejs to build any sort of application even web application but it will take you more time than using existing package.]
You can search for any sort of package at NPM
no, a framework is never necessary to learn the language but the opposite, Learning the language is absolutely necessary to learn the framework.
According to express.js: "Express is a minimal and flexible Node.js web application framework that provides a robust set of features for web and mobile applications." thats all.
I was using flask with python, but I want to develope with node.js because of the libraries, and syntax of javascript, but I am having trouble with finding any good resources for my level
I found Vuejs to be a good framework with plenty of tutorials and a good learning curve. This is good to build a web app.
If you want a simple server to respond to http requests, I'd suggest expressjs
A mix of the two is good for a micro service architecture.
I have a few questions regarding some popular web frameworks. I can find pros and cons about all the frameworks, but which fits best regarding theese criteria:
The website needs to be as secure as possible. It will need a lot of real-time feautures, an own mobile app (native or hybrid, with notifications) and the application will also run a lot of background processes.
Django has some nice security features included, but suits bad for mobile development. The solution is then probably making a completely RESTful API tougheter with Angular and Ionic, but doesn't you loose most of Django's built in security solutions? Will it then be just as safe using a Node framework like Express, and manually escape user input, and manually prevent database injection? Will a good user authentication system then be equal as much work?
In addition, will it be painful to mix synchronous and asynchronous programing using Django channels to implement websockets and real-time features. I don't have any experience using Django channels, but I really likes the simplicity of Socket IO together with Express. Even if it can be challenging to program asynchronous in a Node environment, will it be just as hard using Django channels at the end? And since Django is a full framework, will you after a while have to rewrite a lot of the inbuilt classes and functions? Is it still easier than using Flask with Flask SocketIo? Will it be a good idea to use Python for background jobs beside the Node environment?
I know there already exists enough framework vs framework questions, but i would appreciate any advice and experiences.
Just go ahead and use the socketio in node or flask it is much more adviceable than using the socketio libary in Django.
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
So I am a bit confused in regards to the aim of Angular js vs Express js. From my understanding we use Node.js to serve Angular js but we are not entirely limited/forced to use Node.js for serving it. Express js on the other hand seems like it accomplishes something similar to the more traditional MVC framework.
So is Angular Js a type of non-server-specific MVC framework? and does this limits Angular js backend server capabilities or ease of use?
Express
Express is a web framework, inspired by the Ruby project 'Sinatra'. It's one of many web frameworks in Node
AngularJs
AngularJS is a MVC framework that defines numerous concepts to properly organize your web application. Your application is defined with modules that can depend from one to the others. It enhances HTML by attaching directives to your pages with new attributes or tags and expressions in order to define very powerful templates directly in your HTML. It also encapsulates the behavior of your application in controllers which are instanciated thanks to dependency injection.
AngularJS helps you structure and test your Javascript code very easily.
Answer to your comment which i saw.
So would you say they are for different purposes client-side vs
server-side implementations and therefore mutually exclusive or do you
see a scenario in which one could use Angular Js, Expression js, and
Node.js in the same application?
Yes, they are for different purpose, but they both are MVC based framework. Yes, we can where you can use Angular router, views and controller for front end and use express as your base model to communicate with MongoDB or anyother Database. But yet again its your choice, as you can achieve everything without even bothering AnagularJs.
Adding more.
AngularJS is a beautiful client-side framework, highly testable, that combines tons of cool stuff such as MVC, dependency injection, data binding and much more. If you want to fully take advantage of the AngularJS features you may consider coding the server side using a RESTful approach. you can take advantage of their resource factory, which creates an abstraction of your server side RESTful API and makes server-side calls such as get, post, put, delete etc.
You can use AngularJS for defining your client-side behavior[Views and Controllers] and then write up the REST-Services which AngularJS client can interact with. The client runs on the web browser[AngularJS], and does asynchronous communication to the server. The server[ExpressJS] then retrieves and stores data for the client.
Maintaining a clear distinction between client and server makes the app easier to maintain and test. Adding to it, it all depends upon what you are trying to build and how best you can leverage both of them.
AngularJS is a javascript framework that runs on the client side, on the browser; it has a router, yes, but is only for the client side (in fact, it uses the hash as default).
On the other hand, Node.js runs javascript without a browser, as a service and it can run frameworks like Express, dealing with HTTP and so on, making it a nice web server.
Similarity is both are JavaScript frameworks which means you can write your server side and client side logic both in JavaScript if you were using them together.
Differences would be AngularJS is a client-side framework and Express is server-side framework.
Express can be used with any client-side framework and so can Angular be used with any server-side framework.
I so often see titles like "Node.JS + socket.io tutorials." Even in the Node.js Beginner book I've purchased, it tells me to download socket.io so I'm getting really confused.
What's the difference between them? Why can't I code my applications just with Node.JS "OR" Socket.io? If I can code, why do people socket.io plus node.js in titles?
I'm really confused so any kind of replies would be appreciated.
node.js is a platform.
socket.io is just a framework for dealing with websockets if your are building an app on top of node.js.
socket.io needs node.js but node.js does not need socket.io
EDIT: Ryan Dahl's (node.js's creator) intro video is really instructive and helps with this kind of confusion: http://www.youtube.com/watch?v=jo_B4LTHi3I
Socket.io is a framework on node.js for realtime applications. So, both is required if you want to use socket.io. You can code your own to do the same thing but socket.io is cross-browser and by using it can help you save time.
socket.io is a library, addition to actual platform which is node.js.
It is like a software to computer. You can't use software without computer.
Node.js - is platform, that takes care about language - JavaScript visualization using V8 (JavaScript Engine that interpret JS script to understandable form to the computer). And lots of other components of platform.
While socket.io is just using features of platform, implements some cool own features that are addition to node. It is just a library, addition that you use along with the core.
In real world its like hoover - is a node.js, and nozzle is socket.io. Of course it is rough example, and things are much more complicated. But as you can see, nozzle is pointless without core.
Node.js makes your JavaScript running using own features. While socket.io is something you use or not - by your choice.
I am also learning nitt- griities of nodejs , socket.io , express etc . What I have understood so far is that Nodejs is the big backbone of hosting the entire project ( could be both on client and server's end ) with the node command like > node servercode.js etc . It can open ports for websockets server , Http server even https server .
However socketio provides the communication link between the client and server side in an asynchronous event driven manner ( think ajax ) .
Hope it helped