2

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.

  1. Is this called JavaScript app or Node.js app in real world?
  2. How do I deploy it in AWS?
3
  • 1
    You need static hosting for an HTML/JS app like yours. AWS Elastic Beanstalk is meant to host applications, so you have to provide at least a HTTP server that will publish your HTML pages and assets. I suggest you look for a static hosting platform instead of Beanstalk, it should be easier for you. Commented Mar 1, 2019 at 10:02
  • thanks for your tip. I do tick and untick checkboxes in my "to-do" js app. So do I need to use aws lambda kind of service if I go for any static web hosting provider ? Commented Mar 1, 2019 at 10:07
  • I don't know a lot about AWS, but if I were you, I would read the tutorial ;) Here is what you need: aws.amazon.com/getting-started/projects/host-static-website Commented Mar 1, 2019 at 10:17

4 Answers 4

4

As other have answered (without telling you how to do it) the solution is static web file hosting. You do not need to deploy your app to Elastic Beanstalk as your JavaScript are not executed on the server. They just need to be served to a client where they will execute in the client’s browser.

Amazon S3 is the most cost effective way to serve static HTML website.

The easiest way to setup S3 and deploy your application is to use amplify command line. See the detailed procedure at https://aws-amplify.github.io/docs/cli/hosting

To learn more about Amazon S3 web hosting, please read this https://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html

Sign up to request clarification or add additional context in comments.

Comments

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.

Comments

0

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.

Comments

-1

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.

2 Comments

Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
This does not provide an answer to the question. Once you have sufficient reputation you will be able to comment on any post; instead, provide answers that don't require clarification from the asker. - From Review

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.