Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!
  • Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • You can also use markdown to share your code. When using markdown your code will be automatically converted to BBCode. For help with markdown check out the markdown guide.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.


    To learn more about how to use our BBCode feature, please click here.

    Thank you, Code Forum.

Node.JS Express js not working

I made a server in express.js, Here is the code:

var express = require('express'); var app = express(); app.get('/', (req, res) => { console.log('Ready, and in action!'); res.send(); }) app.listen(443);
It won't send anything to the console. I am using the command prompt. Is there anything wrong?
 
I made a server in express.js, Here is the code:

var express = require('express'); var app = express(); app.get('/', (req, res) => { console.log('Ready, and in action!'); res.send(); }) app.listen(443);
It won't send anything to the console. I am using the command prompt. Is there anything wrong?
Hey!

Have you tried visiting localhost:443 in your browser?
 
The only way I could get it to run through geany was switching to the terminal. I think it's because of a path problem. At least for me anyway.
I had to use another port other than 443. That port is already in use.
I followed the docs her Installing Express
 

Attachments

  • geany.png
    geany.png
    862.3 KB · Views: 2
Last edited:
Hi there,
Someone feel free to call me out on this one lol... but from my own experiences working with node inside of Visual Studio, I know for a fact that VS sets default nodejs server port to 1337 (and yes, I am sure Microsoft is fully aware what that particular number represents lol, why they decided to make their IDE set that for a port number to a server is beyond me XD )... might want to try that, or as @menator01 mentioned, use another port number. Below, I have attached a list of common ports and what services they typically run to help you avoid these situations. Hope this helps 🙂

 

Latest posts

Buy us a coffee!

Back
Top Bottom