WebFaction
Community site: login faq

Hi I'm having issues deploying an angularJS app managed wiht Yeoman/bower/grunt. I created a Node app which serves a subdir (namely "http://[user].webfactional.com/console").

After running grunt and deploying the generated dist folder to webfaction, the script/css files included in index.html have relative paths starting from the dist.public folder, that is:

< script src="app/3d68afb5.app.js" >< /script >

< link rel="stylesheet" href="app/e501ef23.app.css" / >

...

so when the absolute URL is composed the page looks for these resources:

http://[user].webfactional.com/app/3d68afb5.app.js

http://[user].webfactional.com/app/e501ef23.app.css

...

while the correct urls would rather be

http://[user].webfactional.com/console/app/3d68afb5.app.js

http://[user].webfactional.com/console/app/e501ef23.app.css

...

I've gone through grunt documentation as well as Express webframework's, to see if there is a way to specify a host root or baseUrl other than "/", but I must admit I'm quite a newbie with deploying such kind of applications.

Any suggestions to solve this issue?

asked 06 Nov '15, 17:56

lWhitmore
1113
accept rate: 0%


I've gone through grunt documentation as well as Express webframework's, to see if there is a way to specify a host root or baseUrl other than "/", but I must admit I'm quite a newbie with deploying such kind of applications.

I think you need to set the root URL path with the Express router. See this answer to "Is it possible to set a base URL for NodeJS app?" for more info.

Hope that helps!

permanent link

answered 06 Nov '15, 21:51

seanf
12.2k41836
accept rate: 37%

Thans! The link you provided have been really useful to understand where my problem was. Actually I found out that the trick that solved my situation was simply the adding of a base url through the <base> tag in "index.html"

< base href="http://[user].webfactional.com/console/" >

(07 Nov '15, 21:32) lWhitmore
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×15
×12
×4
×3
×3

question asked: 06 Nov '15, 17:56

question was seen: 3,942 times

last updated: 07 Nov '15, 21:32

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM