javascript - Change the URL of node server -
I just deployed my first AngularJS app using Heroku The following is the node script below.
There is URL on the site now. However, I would like to be it How can I do this?
var gzippo = require ('gzippo'); Var Express = Required ('Express'); Var app = express (); an app. Use (gzippo.staticGzip ("+ + __dirname +" ")); App.listen (process.env.port || 5000);
With Express (4x) you can do this for example:
// Announce your router var router = express.Router (); // Define your router router.get ('/', function (rieke, ridge) {// your stuff}} // define other routes and so on ... // ... And make sure that all your routes will be prefixed with the Beta app. ('/ Beta', router); Now, http://project.herokuapp.com/beta is the main path, and the other path always / beta
Comments
Post a Comment