Questions tagged [single-page-application]

0

votes
0

answer
7

Views

Angular single page app works fine, but returns 404 when hitting any page except the main one

I have a single page web application written in Angular. When I run it on the local machine with ng serve, it works fine. When it is deployed to AWS, all pages except the main page return a 404 error. In other words, the 404 error occurs when trying to load any route directly. For example, / return...
K48
0

votes
0

answer
2

Views

Azure - cheapest way to host Angular micro-apps that need url rewrites

I have a SPA that is made up of multiple micro-apps each built with angular. I would like to host on azure as a storage account as it’s all static files, however it requires some url rewrites for various routing reasons and there is no way to configure this in storage accounts. What options do I h...
ib4nez
1

votes
1

answer
155

Views

google not crawling a SPA as expected

I'm using prerender.io, it's working perfectly with other crawlers such as Facebook. But when I ask google to fetch and render my links on the webmaster tools it seems to not fetch correctly even though it renders correctly. To clarify, the image preview of the website in the Rendering tab is correc...
coiso
1

votes
2

answer
157

Views

How Angular SPA relates to REST API

I'm newbie in node and I'm trying to understand how an Angular SPA, that have some states with uiRouter, can relates to an Express REST API to get data from an database. Can anyone please take me an exemple? Thanks
Pablo Darde
1

votes
2

answer
66

Views

What's the best way to log in Single Page Application

Just want some insight on this. Currently I'm using console log in an Angular SPA. but obviously this log is only viewable when I develop it. When it is out there in other people's browse, I have no way to see and check. What library/tools I can use to have this sort of runtime information when the...
Wudong
1

votes
4

answer
389

Views

Aurelia.js pushState doesn't seem work with nested routes - static resources are lost after refresh

My routes: [domain]/manage [domain]/manage/clients [domain]/manage/users I've got pushState set to true. Here's my htaccess: php_value max_input_vars 10000; RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*) /index.html AddType te...
user3139996
1

votes
1

answer
772

Views

Google analytics current pageview URL overwritten by events

Does anyone know the solution to maintaining the correct active page URL when sending events from an SPA using pushstate? Here's the scenario: User arrives at /home (page title is 'Home') and ga is inited: ga('send', 'pageview'); User moves to /my-account (page title is 'My Account'): ga('send', 'pa...
Matt Bindoff
1

votes
1

answer
626

Views

AngularJs logout action

I have implemented authentication, based on jwt tokens in my app. But I have some trouble with logout action. When I press logout, I simply clear my local storage from access_token value. Let's imagine, that user opened three browser tabs with my app. One of them is unprotected and there is some un...
Stalso
1

votes
1

answer
716

Views

Single Page App w/ Login Page

I have been doing some research on this topic but can never find anything super relevant. I am looking to create a single page application using Polymer. I am building this around a REST API that requires authentication to view is resources. I have all the details with API worked out but I can't se...
Andy Weaver
1

votes
1

answer
48

Views

SPA is not working in online hositng

I recently published my SPA to the free account of hostinger.in. In localhost the application works fine. But in online account it not loading views and producing errors in console mentioned bellow. 'XMLHttpRequest cannot load http://error.hostinger.eu/?. No 'Access-Control-Allow-Origin' header is p...
1

votes
1

answer
285

Views

Storing “remember me” cookie and CSRF protection

I've been reading that 'remember me' cookies are stored in 'httpOnly' cookies, so they are not accessible by JavaScript/XSS. However, 'httpOnly' cookies are vulnerable to CSRF attacks because they are sent with the request automatically. To mitigate the CSRF attack, it is recommended to use the syn...
Atif
1

votes
1

answer
88

Views

routerLink error in child route

I have a parent component (profile) and in this component i have Basket route (profile / basket) , this is my Basket component : export class basket extends Ext implements OnDestroy{ private ShopItems_Movies : Array = []; private ShopItems_Music : Array = []; subscriptions : Subscription[] = [];...
1

votes
1

answer
183

Views

How can I handle onchange for a select option in WebSharper UI.Next

I am trying to display a different SPA view based on the option selected from Doc.Select. I would like to handle onchange events using WebSharper UI.Next. I have searched around for some information and have seen on which can be set in the attributes of an Elt, like so: spanAttr [on.click (fun el ev...
Mr. Mr.
1

votes
1

answer
48

Views

Pass an object directly to a value converter instead of manually copying it to a new object

We are passing an object parameter to the following value converter. export class SortValueConverter { toView(array, config) { // do stuff } } We pass the object to the value converter by manually copying it to a new object. ${s.friendlyName} We would like instead to pass the object directly. Ho...
Shaun Luttin
1

votes
2

answer
209

Views

How to protect sensitive data on a SPA using JWT tokens

I'm thinking about making an app with javascript and make it a SPA. Using JWT tokens to authenticate the users and set the user roles on the app, what is the best way to protect sensitive content? Using html templates for logged pages is bad? Should i return always the sensitive content from the api...
1

votes
3

answer
185

Views

gh-pages - share index.html for all routes

I want to serve same index.html page for all (sub)urls in my app on gh-pages is that possible? right now when I go to repo/inner/path I get a 404 so I want to 'force' github pages serve the same root index.html on all routes
goldylucks
1

votes
1

answer
370

Views

JWT stateless sign-on with secure cookie storage : how to implement log out?

I am starting to implement a JWT based Single Sign On system (for several single page apps under the same domain, so something like app1.mydomain.com, app2.mydomain.com, auth.mydomain.com) using the mechanisms described in this article from Stormpath. In order to protect my signed JWT token from XSS...
Pierre Henry
1

votes
1

answer
681

Views

How to host my SPA? Make example.com/spa lead to CDN?

Current state I have an existing SPA application that runs against a backend server. I have Apache being setup on my production server in the following way: DNS example.com points to my production server. There is Apache with proper SSL configuration for my domain example.com/frontend leads to SPA f...
Sebastien Lorber
1

votes
2

answer
1.2k

Views

Sails js route static html

I want to completely separate the client and server sides in my sails js app. If I remove the '/' route, automatically it will serve a file named index.html from the 'assets' folder. I want to serve another file from the assets folder, how can I do it?
user3712353
1

votes
1

answer
1.3k

Views

How to prevent Google AdWords script from prevent reloading in SPA?

I have a SPA built on React JS stack. I'm using react-router to navigate through pages and i need to implement Google AdWords on my website. /* */ I embed this code in body and i run goog_report_conversion when i click on button which navigates me to another page. Which is unwanted behaviour for SP...
WebPal
1

votes
2

answer
74

Views

What we should use instead of Spring Security's JSP tag library to have security in client side in HTML pages?

As you know in the project that the UI is html pages and not jsp (something like jhipster applications), we cannot using from Spring Security's JSP tag library. what is the best strategy to havnig security in client side? for example in jsp pages i use this code to show or hide simple button based o...
Rasool Ghafari
1

votes
1

answer
1.5k

Views

Alternative Single Page Application routing mechanism without hash or regex

I’m working on my own SPA (Single Page Application) stack tool. I’m currently thinking about router mechanism - I have doubts if I should go with hash (#) based router, or think about something else: Use window.history API - twitter already do some small SPA helper: Implementing pushState for tw...
lukaszkups
1

votes
2

answer
422

Views

trouble with routing in AngularJS SPA

I am a beginner to AngularJS and trying to build my first SPA. I have created the routes for a few pages and specified the links in the nav bar. the index file is Toggle navigation Home About Menu Contact ` the routeProvider code is, angular.module('confusionApp', ['ngRoute']) .config(function($rou...
veerreddy.s
1

votes
2

answer
884

Views

ASP.NET MVC SPA - How to handle page refresh in a single page application [closed]

I am building a SPA app using ASP.NET MVC. The entry point of my app is /home/index. All other views will be loaded via ajax. Now, for example, the user is currently on page /home/index#/home/widgetdemo. When he would hit the refresh button now, the following would happen: The index view is loaded a...
Legends
1

votes
3

answer
819

Views

How to implement OAuth2 flow in Single Page Applications (Angular2 + Rails4)

I am wondering which OAuth2 flow best suit the SPA scenario. The front-end is angular and the backend is rails. I think the authorization code grant type is the most adequate for this scenario but I am not sure how to handle the redirection when the user grants access to my application. That redirec...
flyer88
1

votes
1

answer
430

Views

Passing Azure App Service Application Settings to SPA JS-application

Case: The solution consists of two Web Apps configured in Azure App Service. The first one hosts a backend API (Asp.Net Core) and the second one an SPA frontend website. In this project we decided to drop the application server(Kestrel/Node.JS) altogether from the frontend Web App, since there is no...
Juha
1

votes
1

answer
565

Views

Using connect-history-api-fallback middleware in FeathersJS for serving Vue.js SPA

As the title suggests, I'm serving a Vue.js single page application from public/index.html in FeathersJS. Since I'm using vue-router's HTML5 history mode, I have to use a middleware like connect-history-api-fallback in order to rewrite the requested frontend location to /index.html. Setting up this...
Pascal Martineau
1

votes
1

answer
249

Views

live regions not working with dynamic page title - angularjs

Angular changes the view so that the page title changes, but screen readers can't read it, so I tried to use live regions, but that doesn't work. Title here I want to know the reason why live regions not working in this case? I don't need any solution to make user know the page is changed and cont...
Muhnad
1

votes
1

answer
1.6k

Views

Redirect unknown requests to index.html in springboot

I'm trying to get an Angular2 app served up through a springboot web application. I've found lots of examples of how to do this very simply: https://spring.io/blog/2015/01/12/spring-and-angular-js-a-secure-single-page-application#using-spring-boot-cli https://github.com/zouabimourad/angular2-spring/...
Townsfolk
1

votes
2

answer
556

Views

How can I avoid hardcoding URLs in a RESTful client/server web app with deep linking?

I'm working on a SPA which is a client to a RESTful web service. Both the client and server are part of the same project, i.e. I can modify the code for both sides freely. I've been reading up on RESTful API design to try and make sure I'm doing everything the 'right' way. One of my takeaways from...
Dan Passaro
1

votes
1

answer
305

Views

Testing Azure Active Directory security locally

I have a web application deployed on Azure with the Azure Active Directory security enabled (the express setting). So, when I try to access the application, I need to be a part of the AD to have access. I would like to add more features to the application, like displaying the current user logged in,...
Elferone
1

votes
2

answer
24

Views

Redirect user and always ensure full page load/reload

If I am on the page http://mywebsite.com/contact and I do: window.location.assign('http://mywebsite.com/contact#foo'); The page doesn't refresh and I understand thats desired. But I want to refresh/reload the page (to update the users cache). Is there a Javascript or JQuery function that I can use...
Jake M
1

votes
1

answer
35

Views

Is it good to include all js file and css file in the main page as AngularJS way?

I work with AngularJS for several months, but I am still confused at the point: Is it good to include all JavaScript and CSS files in the main page the AngularJS way? In my opinion, it may cause many conflicts when using many CSS and JS plugins. Also, the web browser loads too many files that may no...
WhiteDragon
1

votes
1

answer
1.4k

Views

Optimizing video loading on web page

I have a single page application which contains multiple video tags in each section. Height of the window is height of the section. Each tag has a different videos with the format of MP4. I want to load these videos quickly without impacting the page load time so I have tried it to load by lazy load...
Gowtham E
1

votes
1

answer
383

Views

'Promise' is undefined error in ASP.NET Core SPA Template for Aurelia

I have installed the ASP.NET Core SPA Templates: dotnet new --install Microsoft.AspNetCore.SpaTemplates::* But when I try to open the site in I.E 11 I get error ''Promise' is undefined'. What is the best way to fix this?
Poppert
1

votes
4

answer
116

Views

How can I add an external javascript tag to an Ember JS app without touching the index.html?

Is it possible to load an external javascript resource in Ember without touching index.html? If I could add to html, I would simply add the following and it works. var my_data = [{ foo: 'bar', value: 1.234 }]; I tried appending the tag using jQuery, but it won't actually launch the javascript on the...
Ryan
1

votes
1

answer
30

Views

Selecting a REST server using Geolocation

Suppose a single page application that consumes rest services is loaded in Singapore and there are two possible locations hosting the REST / edge services that the application consumes, one in New York and one in Singapore. Anyone know of a javascript framework that would allow the app to select th...
Ole
1

votes
1

answer
23

Views

How do I Load a Partial View and Fetch Json Data with an API

I am creating a single page application and i need expert advice on which to load first, the view or the json data via rest api? The app is full out SPA with the data in each view being constantly refreshed on intervals. My problem is, i want to try to merge the json data with the view as quick poss...
Eshiett Oto-obong
1

votes
1

answer
430

Views

S3 and CloudFront website hosting for multiple SPA redirect to different index.html based by url path

I have a single S3 bucket for multiple Single Page Applications, and enabled static website hosting for this bucket. Bucket has the following folders and files (firstApp & secondApp are folders and correspond to different SPA): firstApp index.html *.js & *.css files secondApp index.html *.js & *.css...
Vasiliy Sarzhynskyi
1

votes
2

answer
56

Views

Angular 2+: share component reference using a service

I have an Angular component called 'tree'. What I want is to call methods on tree from any other component in my app. There will only be one tree in my entire app at any time. Is it ok to create the component in the place I want to view it and share the componentRef using a service this way: export...
XandruDavid

View additional questions