HotTowel-Angular icon indicating copy to clipboard operation
HotTowel-Angular copied to clipboard

base url for app

Open techfort opened this issue 9 years ago • 2 comments

Is it possible to set a base url (a bit like a java context) for the app? i tried the usual approaches, configuring the app with use(), making the main app a sub-app of a parent app, using express().Router, to no avail. If you have any suggestions or even better a ready-made approach, that would be great. Basically I'd like to run the entire app at http://localhost:3333/foo

techfort avatar Apr 13 '15 18:04 techfort

Can you try: app.use('/foo', express.static('./src/client/'), app.use('/foo/*', express.static('./src/client/index.html')) and set the base URL in index.html: <base href="/foo/">

baopham avatar Jul 11 '15 22:07 baopham

Hi , I tried the above suggestion its not working for me. I made the changes in app.js as follows, app.js app.use('/foo',express.static('./src/client/')); app.use('/foo/*', express.static('./src/client/index.html')); in index..html <base href="/foo/">

still not app not able to find resource files . Please help thanks in advance

BenihimeU avatar Nov 23 '16 05:11 BenihimeU