single-page-application

Add _redirects file to root path for Vue SPA hosted on Netlify

蹲街弑〆低调 提交于 2019-12-02 17:43:36
I'm developing a Single Page App using Vue CLI and want history pushstate to work so I get clean URLs. I have to follow this: https://www.netlify.com/docs/redirects/#history-pushstate-and-single-page-apps and add a _redirects file to the root of my site folder with the following: /* /index.html 200 The problem is I don't know how to add this _redirects file to the root of my dist folder. I tried adding it to the static folder but it ends up in a subfolder and not in root. How can I include this file so that history mode works after deploying on Netlify ? // config/index.js build: { // Paths

Recommended authentication UX in AngularJS SPA with own and external (Google, FB…) profiles

瘦欲@ 提交于 2019-12-02 16:25:56
I'm developing an Asp.net MVC + Web API + AngularJS SPA. I would like to have several types of registration/authentication: own profile provider external providers ie Google, FB etc. Possible scenarios As I'm having an SPA it would be best if I could keep my user on my page while external (or internal for that matter) would be taking place. I'd display a modal layer with particular content loaded (maybe even inside an iframe ). Can this be done? Online examples? Have login/registration capability implemented as usual Asp.net MVC full page reload controller/views and then redirect back to my

Authentication for users on a Single Page App?

折月煮酒 提交于 2019-12-02 14:52:05
I have developed a single page app prototype that is using Backbone on the front end and going to consume from a thin RESTful API on the server for it's data. Coming from heavy server side application development (php and python), I have really enjoyed the new different design approach with a thick client side MVC but am confused on how best to restrict the app to authenticated users who log in. I prefer to have the app itself behind a login and would also like to implement other types of logins eventually (openid, fb connect, etc) in addition to the site's native login. I am unclear how this

Angular.js routes not working on WAMP

烈酒焚心 提交于 2019-12-02 14:03:15
问题 I am working on setting up an Angular.js single page application built with an Express, Node, mySQL stack. I have set up the following code for the routes: angular.module('myApp', ['myApp.filters', 'myApp.services', 'myApp.directives']). config(['$routeProvider', '$locationProvider', function ($routeProvider, $locationProvider) { $routeProvider .when('/', { templateUrl: 'partials/index', controller: IndexCtrl }) .when('/addPost', { templateUrl: 'partials/addPost', controller: AddPostCtrl })

What happens when you enable the html5 mode in mode in angularjs?

五迷三道 提交于 2019-12-02 11:03:59
What actually happens when you enable the html5 mode ? This might go back to the point how routing takes place in single page applications What I perceived before(it may be wrong) : Looking at the dirty url in the angularjs application I always assumed it being url fragment to which different views are bind for different fragments. So in short we already have all the pages and a particular fragment is being displayed for a particular url . Now in order to remove the hash you have to set html5mode true and you have to tell the server to return the index page for every request other than your

AngularJs Routing without hashtag in link?

孤者浪人 提交于 2019-12-02 10:19:59
I've recently began learning AngularJs for web development and am loving it so far. However, I'm not so sure about having hashtags withing the link when routing between views. My main concern is how Google will cache the pages on the site and whether the links will work both ways, i.e. whether users can just click www.sampledomain.com/#/orders/450 and be directed straight to the order page. Is this an okay method or is there a way to route views without the hashtag? When I remove the hashtag, the reload the page and gets 404 error. Can anyone give me a decent explanation of what is going on.

Angular.js routes not working on WAMP

隐身守侯 提交于 2019-12-02 07:07:18
I am working on setting up an Angular.js single page application built with an Express, Node, mySQL stack. I have set up the following code for the routes: angular.module('myApp', ['myApp.filters', 'myApp.services', 'myApp.directives']). config(['$routeProvider', '$locationProvider', function ($routeProvider, $locationProvider) { $routeProvider .when('/', { templateUrl: 'partials/index', controller: IndexCtrl }) .when('/addPost', { templateUrl: 'partials/addPost', controller: AddPostCtrl }) .when('/readPost/:id', { templateUrl: 'partials/readPost', controller: ReadPostCtrl }) .when('/editPost/

How to work around the 404 error on nginx?

。_饼干妹妹 提交于 2019-12-02 04:43:16
问题 I have an angular 4 SPA app and I'am using docker for production. Looks fine so far. Via terminal I go to /dist folder and from there I let docker point to the content of dist with the following command: docker run -d -p 9090:80 -v $(pwd):/usr/share/nginx/html nginx:alpine I call: localhost:9090 on the browser and can access the app. The issue is when I reload the page once again and/or as specific route, then I get 404 Not Found and the nginx version e.g. nginx/1.13.5 . I have been searching

How to prevent a user from resubmitting a form?

我怕爱的太早我们不能终老 提交于 2019-12-01 22:10:56
I am developping a Single Page Application . At the end of the application, the user gets to submit his contact information (name, phone number, etc). This sends an Email and modifies the page to a "Thanks for submitting [...]" page. The problem is, the client can press the Back button and REsend the Email. Is there a way to prevent this sort of.. spam? Code Sub BT_Send(sender As Object, e As EventArgs) Handles BT_Send.Click Try 'Creating the Email Message Dim mailMessage As New MailMessage() mailMessage.To.Add("SomeOne@a.com") mailMessage.From = New MailAddress("Robot@a.com", "Robot")

Query about accessing HttpOnly Cookie & Secure cookie

折月煮酒 提交于 2019-12-01 10:41:09
问题 I am working on RESTful SPA app using angularJS. Currently initial REST call is setting a "token" cookie on xyz.com ( secured response cookie) after successful user login. I am not able to read this cookie in Javascript/angular as I am working on localhost. What I understood here , unless I run this app from xyz.com , i wont be able to access this cookie OR do I need a secured connection ? Is my Understanding correct ? Secondly, my understanding about "httponly" cookie is that , it wont be