Docs Menu

Docs HomeAtlas App Services

Host a Single-Page Application

On this page

  • Overview
  • Procedure
  • Upload Your Built Application to App Services
  • Configure App Services to Serve Your Application
  • Pull the Latest Version of Your App
  • Add Your Built Application Code
  • Configure App Services to Serve Your Application
  • Deploy the Updated Hosting Configuration

Many web applications built with modern frameworks, like React, Vue, and Angular, are single-page applications (SPAs) that dynamically handle routing and rendering client-side instead of fetching each rendered page from the server. You can use Atlas App Services to host your SPA and serve it to clients.

To host your app, you need to specify that it's a SPA in App Services. By default, App Services handles requests for a given resource by returning the file hosted at the specified resource path or a 404 if no file matches the path. However, SPAs render in a single, specific HTML file so all requests should return that file regardless of the requested resource path.

This guide covers how you can configure App Services Hosting to redirect all resource requests to a single file to support the SPA pattern.

Note

404 Errors in Single-Page Apps

When single-page application hosting is enabled, App Services always returns an HTTP 200 response with the app root regardless of the requested route. This means that you cannot specify a custom 404 page for a SPA. Instead, you should include custom code in your application to handle invalid routes.

←  Flush the CDN CacheUpload Content to Atlas App Services →