'JavaScript vs Node.js
I have simple "to-do" application written in JavaScript and HTML. I don't even have CSS file, just have bit of in-line style in index.html file where I have linked my JavaScript file. No database or any other stuff needed. Simple app using vanilla JavaScript and HTML.
I have AWS free tier account and tried zipping .js and .html files and deploying to AWS Elastic Beanstalk but it's converting into node.js and keep looking for JSON file and deployment is unsuccessful.
- Is this called JavaScript app or Node.js app in real world?
- How do I deploy it in AWS?
Solution 1:[1]
You are a bit confused on the two "terms" -> Javascript and NodeJS.
- Javascript: is a high-level interpreted programming language;
- NodeJS: is an open-source, cross-platform JavaScript run-time environment that executes JavaScript code outside of a browser.
So, in your case, since you are not using any "backend", as suggested by other users you should use a simple web hosting.
Solution 2:[2]
Node.js is a Runtime Environment to run Javascript Code on the server i.e. on any machine with an operating system. So all Node.js apps will be Javascript apps but not all Javascript apps will be Nodejs apps. In your case since you have an HTML file and your javascript file might be manipulating the DOM it would be classified as a Javascript app for the browser. However if you have a javascript file which is not manipulating the DOM, you can run that on a Node.js environment.
I hope i have answered your first question, although i cant answer your second question at this moment.
Solution 3:[3]
JavaScript is a language.node.js is not a language or a special dialect of JavaScript - it's just a thingamabob that runs normal JavaScript.All browsers have JavaScript engines that run the JavaScript of web pages. Node.js is simply the V8 engine bundled with some libraries to do I/O and networking. so that you can use JavaScript outside of the browser, to create shell scripts, backend services or run on hardware.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Dave |
| Solution 2 | Apoorv |
| Solution 3 | Sultan Razib |
