angularjs - Angular.js - Do I need to design 2 apps or only one? -
i defined 2 virtual servers nginx handle
marketing stuff , user authentication on master domain www.example.com ,
the admin app on subdomain admin.example.com once user authenticated
server { listen 8080; server_name example.com; root html; location / { index index.html index.htm; } server { listen 8080; server_name admin.example.local; root html/admin; location / { index index.html index.htm; } }
i handle marketing stuff angular.js one-page app , admin stuff angular.js multi-page app..
is possible ? should design 2 apps or 1 ap ?
i don't think should split them require lots of same functions / data. think dry design.
you not want have maintain 2 codebases 1 project or have patch things twice everytime there change in api.
look closely $route documentation , plan implementation accordingly: can have isolated path admin without having duplicate anything. also, on same domain might run weird xhr issues have code for.
in short, here's answer: don't split it. if absolutely want have admin.domain.com, redirect dns domain.com/admin , deal within single codebase. down line can refactor code match exact behavior want. have here inspiration: dynamic routing sub domain angularjs
Comments
Post a Comment