angularjs - REST API from sails.js and webUI on nginx -


i came across sails.js , loved (so still newbie). question related deployment of me webservices , ui.

my application have web ui mobile ui , have chosen following: web ui - angularjs + bootstrap mobile ui - angularjs + bootstrap + cordova (for native api access)

i want maintain common code across web ui , mobile ui. options have host sails.js webservices api server , host ui in separate server (like nginx / apache). have selective separation of code (esp. landing page + native layer access).

what pros/cons of approach? experiences, inputs helpful.

not sure if understood correctly question think overcomplicating. here take:

you don't need separate api , webapp itself. can put sails running on specific port (1337 default) , nginx in front reverse proxy, forwarding connections sails , serving static files conform ui (js, css, fonts, etc).

here's , example configuring nginx , node app setup.


you've got 2 options:


a - responsive design webapp

a responsive sails webapp bootstrap or foundation allows share 100% of ui. serve compiled , minified statics webserver nginx (or better cdn) angular logic, styles, etc

browsers , mobiles connect sails api (i.e: yourdomain.com/api/v1/)


b - webapp + cordova mobile native app

if go cordova cos need native access, ui files native device.. you're sharing logic little ui (unless have responsive design in webapp , borrow code it).

in case mantain series of css , angular modules in separated repo shared among both ui's , load via git submodule or similar. (personally) prefer separated codebases or responsive webapp. depends on how big app's codebase grows.

webapp , cordova app still connect sails api (i.e: yourdomain.com/api/v1/)


hope helps


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

inno setup - TLabel or TNewStaticText - change .Font.Style on Focus like Cursor changes with .Cursor -