Starting up with node

Question:
I am trying to startup a node.js server project. Very simple project where REST API calls such as GET returns a counter of how many times the server has had the GET requests.

I do not understand

  1. How can i test this locally? Where can i run Curl for instance (where is the terminal)? IN the console, curl is not recognized (nor dir, ls … etc).

  2. How can I choose port in the correct way?

  3. How do i find the IP adress so that i can test this online?

  4. Is there anything i need to do in order to have this code available online (so i can run CURL commands from my PC to test) ?

My project name: NodeHelloWorldCounter


Repl link:

code snippet
1 Like
  1. You run shell commands in the tab called Shell

  2. You shouldn’t need to worry about the port on Replit, you will need to set the host to “0.0.0.0” though

  3. Your server will be served at the domain replname.username.repl.co

  4. If I understand what you’re asking correctly, no

1 Like

Thank you, great input.

Now when i am testing with curl on my PC, i get the following response:
curl: (60) SSL certificate problem: certificate has expired

i have to add the --insecure flag:
curl --insecure https://NodeHelloWorldCounter.hiwamobaraz.repl.co

How do i solve this? I do not get this error if i run curl from my PC to for instance IFTTT webhook that also takes a GET request.

Heya! Welcome to the community! If you want to make a GET request, you can use node.js in the shell to do it.