I want to run sails.js application ny default to 80 not 1337.
My local url must be like this http://localhost not http:localhost:1337
Set the port in config/local.js to 80, or specify env PRODUCTION and add the conditional. If you do this (run on port 80), you must either run sails as root, or forward a port higher than 1024 to port 80 (because ports under 1024 require root privilege).
Here's an example to use with iptables:
--iptables -A INPUT -i eth0 -p tcp --dport 80 -j ACCEPT
--iptables -A INPUT -i eth0 -p tcp --dport 8080 -j ACCEPT
--iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080
Update: Please ask this question on stackoverflow! We keep asking you to do that. At some point people will start ignoring you. So post this question on stackoverflow so it can be answered in dept there.
i change like this below in local.js
/**
module.exports = {
// The port setting determines which TCP port your app will be deployed on
// Ports are a transport-layer concept designed to allow many different
// networking applications run at the same time on a single computer.
// More about ports: http://en.wikipedia.org/wiki/Port_(computer_networking)
//
// By default, if it's set, Sails uses the PORT environment variable.
// Otherwise it falls back to port 1337.
//
// In production, you'll probably want to change this setting
// to 80 (http://) or 443 (https://) if you have an SSL certificate
port: process.env.PORT || 80,
// The runtime "environment" of your Sails app is either 'development' or 'production'.
//
// In development, your Sails app will go out of its way to help you
// (for instance you will receive more descriptive error and debugging output)
//
// In production, Sails configures itself (and its dependencies) to optimize performance.
// You should always put your app in production mode before you deploy it to a server-
// This helps ensure that your Sails app remains stable, performant, and scalable.
//
// By default, Sails sets its environment using the NODE_ENV environment variable.
// If NODE_ENV is not set, Sails will run in the 'development' environment.
environment: process.env.NODE_ENV || 'PRODUCTION'
but still http://localhost not working
it gives blank page
http://localhost:80 also not working
Read my previous answer.
http://localhost:8080/ like this working but http://localhost not working
Read my first answer.
Do u have full source code..
Just chiming in here as @rRWOverdijk already said it, just didn't give a command .. node can't lift sails on lower level ports without a sudo infront of it.. sudo sails lift
sudo sails lift
this command not working for centos ....
http://localhost:8080/ like this working but http://localhost not working
Someone from Balderdash... please... stop the insanity... block this user... @jigneshnavsoft
pl. dont do this. I will take care men..
Yes i got the result ...thanks a lot men
@mogga I didn't even know that was possible (otherwise I'd have suggested it myself). Thanks! :)
Thanks men
Thanks men
thanks men
He will take care, men.
funny post, men :)
pl. dont do this. I will take care men..
Yeah, and yes, thanks man. D ! :) Take Care ! :D
oh god men, so many email alerts, men. unsubscribe, men.
thanks ..am in love with sails
I want to run sails.js application ny default to 80 not 1337.
My local url must be like this http://localhost not http:localhost:1337
Run with port as an option
sails console --port 1338
try this open config/env/production.js and scroll down, find //port 80 end then, uncomment it , work well for me
Most helpful comment
Set the port in
config/local.jsto 80, or specify env PRODUCTION and add the conditional. If you do this (run on port 80), you must either run sails as root, or forward a port higher than 1024 to port 80 (because ports under 1024 require root privilege).Here's an example to use with iptables:
Update: Please ask this question on stackoverflow! We keep asking you to do that. At some point people will start ignoring you. So post this question on stackoverflow so it can be answered in dept there.