4

I've created a REST API using Node.js and Express, so now I need to share it and publish it on a server in order to connect from Front-end. Can you tell me a proper way to do it?

2

3 Answers 3

3

You could use Heroku for deployment, this way you can know how your app will fare. It's free moreover.
If you're satisfied with it then you can go ahead and buy a dyno or use other platforms like Azure or AWS.

To learn more on how to deploy your existing app to Heroku, visit this page.

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

Comments

1

The question you are asking is very broad. It can be done in a lot of ways. For me this 2 part tutorial was very helpful: https://hackernoon.com/tutorial-creating-and-managing-a-node-js-server-on-aws-part-1-d67367ac5171. However, this only covers the installation on AWS EC2. This doesn't differ much from deploying it to Google Cloud, Azure or something local.

In general you need to fix the following steps:

1) Create a server somewhere (local or in the cloud)

2) Install all the stuff to run your app. In your case Node.js at least

3) Put a copy of your app on the server

4) Run it with node

5) Go to the ip of the server

The tutorial gives more details. DISCLAIMER: If you actually want to use this in production there is way more to consider. For example, security policies, setting up proxies, installing certificates etc. Please read up on that properly before you start running production apps.

Comments

1

You can install node on the the production server and then where the project is situated just .

copy that path

Open the Cmd >>

Enter "cd copied path .>>enter

you npm will be install & REST Api will Work.

Comments

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.