javascript - Trouble using grunt connect server on heroku -


All Tutorials I have some kind of app to run my node server on Heroko You can use JS.

I have already configured my hard-to-connect function to use modRewrite for my single page app so that all requests are returned to index.html. So it would be convenient for me to run my code once I installed it on my package.

I have tried to add this line to my package. Jason

  "script": {"post-installation": "PostOpple time echo; ./node_modules/grunt/lib/grunt.js dist"}   < p> But I think there is something wrong in my way, because it does not work, I get a denial error with one permission.  

I also got a simple app. Trying to use the JS Express server (although I'll have to figure out how to do modRewrite again) - but this line - Heroku was looking for an index.js, which I did not have.

Thank you!

My solution has ended with a simple connect server that has the same modRewrite code from my grunts Uses:

  var connect = requires ('connect'); Var modRewrite = Required ('Connect-Moderite'); Var app = connect () .use (modRewrite (['^ [^ \\.] * $ /index.html [L]'])) .US (Connect. Static ('. / / Dist /')) .listen (Process.env.port || 3000)   

and the following process:

  Web: node app.js    

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -