Testing to Deployed a Node.js Back-End Notes App API in Google Cloud Platform with Google Compute Engine Virtual Machine (VM) Instances.
- Run
npm install
to install all of the required dependencies. - Start the server in Production mode run
npm run start
and to start in Development mode just simply runnpm run dev
that's pretty much it.
Note: Make sure that
disable
the value of Block insecure private network inchrome://flags
to avoid Same-Origin Policy problems in browser. After that don't forget to set it back to thedefault
value.
Go to Google Cloud Console and create a firewall rule and VM instance.
- Create a firewall rule Navigation menu > VPC network > Firewall
Properties | Values |
---|---|
Name | app-server-firewall |
Paragraph | Allow Custom TCP Port 5000 |
Targets | Specified target tags |
Target tags | web-server |
Source filter | IPv4 ranges |
Source IPv4 ranges | 0.0.0.0/0 |
Protocol and ports | Specified protocols and ports > check tcp > fill 5000 |
- Create a VM Instance Navigation menu > Compute Engine
Properties | Values |
---|---|
Name | web-server |
Region | asia-southeast2 (Jakarta) |
Zone | asia-southeast2-a |
Machine type | e2-micro (2 vCPU, 1 GB memory) |
Boot disk | Type: New balanced persistent disk |
Size: 10 GB | |
Image: Ubuntu 20.04 LTS |
Test the Back-End System in here