This is definitely much better put together than other guides I’ve seen, however I feel you should specify that this is a static website.
Its still possible to make it dynamic, angular and react will still work for example.
Yes, but my point was this specifically shows you how to make a static website, not that it isn’t possible to make a dynamic website.
I assume you are talking about using the app.get/post/etc
methods which would make the site more dynamic in the responses you can provide correct?
I think there may be confusion here in this conversation between a dynamic front end such as React, Angular, Vue, etc and a statically served site which doesn’t have a dynamic request function.
I’m talking about the website itself serving static content.
Yes that is exactly what I was talking about. There’s a difference in the content served and the front-end changing the content via JavaScript frameworks. I was just trying to see if I could clear up or focus on what specifically you were trying to get at. The app.get
and other methods would allow you to change the response dynamically based on e.g. cookies or the IP.
Correct, we’re both talking about the same thing. You can make this dynamic, however you mention “Beginners Guide” and I guarantee most people following this guide wouldn’t know how to, especially since the code stated above is only used for static content.
This isn’t really a guide, more like a website example since you’re not really teaching anything. You’re using HTML and web JS to make the website whereas node JS is for applications.
Its a step by step processing to serving up a basic site page so hence it is a guide.
Some server code guide , I have been in and out of making websites for years but never really understood the server side using node.js or php.
You should look into the MEAN Stack then, personally I prefer AngularJS over Angular 2+
Personally, prefer Django framework due to it being high level but great tutorial anyways!
Great guide!
If I am to add something, I want people to be aware of the difference between syncronous functions and asyncronous functions - knowing the difference between the two is important as using one inappropriately could block the Event Loop (meaning all user actions on that process are blocked until that method is finished) and drastically decrease performance in your site.
For example, if you’re using fs (file system module) to append data to a file, you would want to use: appendFile, rather than appendFileSync.
Another great performance tip is to set the environment variable to PRODUCTION - this will majorly increase the speed of your web application.
Thanks for the guide, and I hope people enjoy making websites with NodeJS - programming in Node is a lot different than something like Python, so I wish you all good luck in learning it.
My professor only allowed me 12 slides and this is 10 lol.
Loos good! Should use pug though instead of html, looks better and easier to write with.
React isn’t a framework, it’s a library. I’m a big fan of it but I know that it’s not a framework.
React is a framework. Just because it’s using JavaScript and Node does not mean it’s a library instantly.
Its not a framework because it doesnt encompass all of the tools in a full development environment such as linting for example. Compared to Angular it is absolutely a library.
There is a big difference, and React is meant to be expanded upon by 3rd party libraries to make up a framework.
A library is a packet of functions and components to do a specific job.
A framework is something that is the “whole” of what your project being handled by.
Especially now that you can have private repos for free
Couldn’t have explained it better.