single-page-application

Best practices for authentication and authorization in Angular without breaking RESTful principles?

谁说我不能喝 提交于 2020-01-28 13:05:58
问题 I've read quite a few SO threads about authentication and authorization with REST and Angular, but I'm still not feeling like I have a great solution for what I'm hoping to do. For some background, I'm planning to building an app in AngularJS where I want to support: Limited guest access Role-based access to the application once authenticated Authentication via APIs All of the calls to the REST API will be required to occur over SSL. I'd like to do build the app without breaking RESTful

My SPA files are giving 404 errors when serving the SPA in a branch of the request pipeline. How do I make my static files available to my SPA?

余生长醉 提交于 2020-01-23 19:47:29
问题 First of, in my project root I have a folder called ClientApp , which contains a folder build which is where the output of my frontend build is located. Then, in Startup.cs , I have the following in ConfigureServices : public void ConfigureServices(IServiceCollection services) { ... services.AddSpaStaticFiles(configuration => { configuration.RootPath = "ClientApp/build"; }); } Following, my Configure method looks as follows: public void Configure(IApplicationBuilder app, IHostingEnvironment

My SPA files are giving 404 errors when serving the SPA in a branch of the request pipeline. How do I make my static files available to my SPA?

放肆的年华 提交于 2020-01-23 19:46:19
问题 First of, in my project root I have a folder called ClientApp , which contains a folder build which is where the output of my frontend build is located. Then, in Startup.cs , I have the following in ConfigureServices : public void ConfigureServices(IServiceCollection services) { ... services.AddSpaStaticFiles(configuration => { configuration.RootPath = "ClientApp/build"; }); } Following, my Configure method looks as follows: public void Configure(IApplicationBuilder app, IHostingEnvironment

How to test AntiForgeryToken in MVC4 with backbone Single Page Application

落花浮王杯 提交于 2020-01-23 11:09:11
问题 I am having problems getting Microsoft's MVC's [ValidateAntiForgeryToken] to work with a Single Page Application (SPA) written using Marionette & Backbone. The problem seems to be that the MVC [ValidateAntiForgeryToken] method fails to see the token we send as part of the JSON. We thought it was because the token had to be in the Forms part of the reply but MrOggy85 says that isn't a problem (see his answer below). The code is in my api controllers, which use AttributeRouting, which we assume

Client Side Deep Links with WebpackDevMiddleware 404s

空扰寡人 提交于 2020-01-23 04:58:08
问题 I am using the WebpackDevMiddleware for Development builds to serve up a Vue.js application that uses client-side routing. The SPA application is served up from the root url just fine, but if I attempt to use any client-side deep links, I get a 404. Note running as Production works as expected. What I want: http://locahost/ - serve up the vue app. http://localhost/overlays/chat - serve up the vue app. http://localhost/api/* - serve up the api routes handled server side. There is a minimum

How can I get AngularJS working with the ServiceStack FallbackRoute attribute to support HTML5 pushstate Urls?

对着背影说爱祢 提交于 2020-01-22 20:40:27
问题 I am building a client/server solution, using an AngularJS Single Page App as the client component and a Self-Host ServiceStack RESTful API as the server component. A single Visual Studio Console Application Project holds HTML and JavaScript files for the AngularJS component, along with C# classes for bootstrapping the ServiceStack AppHost (I have devolved Interface and Service responsibilities to separate Visual Studio Projects). I have set all HTML and JavaScript files to have a 'Build

Cancel route using Sammy.js without affecting history

浪子不回头ぞ 提交于 2020-01-22 18:15:33
问题 I want to intercept all route changes with Sammy to first check if there is a pending action. I have done this using the sammy.before API and I return false to cancel the route. This keeps the user on the 'page' but it still changes the hash in the browsers address bar and adds the route to the browsers' history. If I cancel the route, I dont want it in the address bar nor history, but instead I expect the address to stay the same. Currently, to get around this I can either call window

Breeze with a Unit Of Work/Repository pattern

安稳与你 提交于 2020-01-22 14:17:04
问题 I was just wondering how I should go about implementing breeze's EFContextProvider in a separate data layer project. Also, since that project is a class library and not an MVC 4 application, how should I include this into my project? I don't really need the whole bag of tricks that is in the Breeze NuGet package, just EFContextProvider stuff. I want to implement a Unit of work pattern using the EFContextProvider DbContext wrapper, like John Papa has done in his wonderful pluralsight course.

Multiple Aurelia apps on one page

我们两清 提交于 2020-01-20 08:24:03
问题 As there isn't much information about Aurelia framework I got stuck with these 2 questions. Is it possible to create multiple Aurelia apps on single page and how this can be achieved? Alternatively is there a way to call out single application templates in 2 different places outside the main app container? For example I want to use Aurelia SPA in CMS system and call it out in different elements like header, main container and aside container. 回答1: Yep, just add two elements to the page with

Multiple Aurelia apps on one page

偶尔善良 提交于 2020-01-20 08:22:29
问题 As there isn't much information about Aurelia framework I got stuck with these 2 questions. Is it possible to create multiple Aurelia apps on single page and how this can be achieved? Alternatively is there a way to call out single application templates in 2 different places outside the main app container? For example I want to use Aurelia SPA in CMS system and call it out in different elements like header, main container and aside container. 回答1: Yep, just add two elements to the page with