⚡
Serverless API Gateway Documentation
Creator
⚡
Serverless API Gateway Documentation
  • Serverless API Gateway
  • Getting Started
    • Introduction
    • Cost
  • Configuration
    • Overview
    • Servers
    • Service Binding
    • Paths
      • Add and Remove Prefix
    • Authorizer
    • CORS
    • Variable Mapping
      • Priority Variables
    • Integrations
      • Auth0
  • Deployment
    • Wrangler
    • GitHub Actions
  • Glossary
    • A
      • API (Application Programming Interface)
      • API Endpoint
      • API Gateway
      • API Key
      • API Rate Limiting
      • Asynchronous Operation
      • Authentication
      • Authorization
    • B
      • Backend as a Service (BaaS)
      • Blueprint
    • C
      • Cache
      • CDN (Content Delivery Network)
      • CI/CD (Continuous Integration/Continuous Deployment)
      • Client
      • Client-Side Rendering (CSR)
      • Cloud Service Provider (CSP)
      • Cluster
      • Container
      • Continuous Delivery
      • Continuous Integration
      • Cron Job
    • D
      • Data Lake
      • Data Warehousing
      • Database
      • Deployment
      • DevOps
      • Distributed System
      • DNS (Domain Name System)
      • Docker
      • Domain
    • E
      • Edge Computing
      • Elasticity
      • Endpoint Security
      • Environment Variables
      • Event-Driven Architecture
    • F
      • Fault Tolerance
      • Firewall
      • Function as a Service (FaaS)
    • G
      • Git
      • GraphQL
    • H
      • Hashing
      • High Availability (HA)
      • HTTP (Hypertext Transfer Protocol)
      • HTTPS (Hypertext Transfer Protocol Secure)
    • I
      • Infrastructure as a Service (IaaS)
    • J
      • JSON (JavaScript Object Notation)
    • K
      • Kubernetes
    • L
      • Latency
      • Load Balancer
      • Logging
    • M
      • Microservices
      • Middleware
      • Migration
      • Mocking
      • Monolithic Architecture
      • Multi-Cloud
    • N
      • Network Protocol
    • O
      • OAuth
      • Object Storage
      • Orchestration
    • P
      • PaaS (Platform as a Service)
      • Payload
      • Performance Testing
      • Plugin
      • Private Cloud
      • Public Cloud
      • Pull Request
    • Q
      • Query Language
      • Query Parameters
      • Queue
    • R
      • Rate Limiting
      • Real-Time Processing
      • Redundancy
      • Refactoring
      • Regression Testing
      • Repository
      • REST (Representational State Transfer)
      • Rollback
    • S
      • SaaS (Software as a Service)
      • Scalability
      • Schema
      • SDK (Software Development Kit)
      • Service Mesh
      • Session
      • SLA (Service Level Agreement)
      • SOAP (Simple Object Access Protocol)
      • State
      • Stateless
      • Static Site Generator
      • Storage
      • Stress Testing
      • Swagger (OpenAPI)
Powered by GitBook
On this page
Edit on GitHub
  1. Configuration
  2. Paths

Add and Remove Prefix

Path and proxy structure let you add prefixes to path before passing request to servers.

{
    ...
    "servers": [
        {   
            "alias": "prefixing",
            "url": "https://sub.serverlessapigw.com/prefix/"
        },
        ...
    ],
    ...
    "paths": [
        {
            "method": "GET",
            "path": "/{.+}",
            "integration": {
                "type": "http_proxy",
                "server": "prefixing"
            }
        },
```

With the above configuration, any GET request to the API will be proxied to 'https://sub.serverlessapigw.com/prefix'.

For example: GET https://api.yourdomain.com/path will be proxied to GET https://sub.serverlessapigw.com/prefix/path.

This method can also be used to remove a portion of the path from the beginning:

{
    ...
    "servers": [
        {   
            "alias": "prefixing",
            "url": "https://sub.serverlessapigw.com"
        },
        ...
    ],
    ...
    "paths": [
        {
            "method": "GET",
            "path": "/prefix/{.+}",
            "integration": {
                "type": "http_proxy",
                "server": "prefixing"
            }
        },
```

With this configuration, GET https://api.yourdomain.com/prefix/path will be proxied to GET https://sub.serverlessapigw.com/path.

PreviousPathsNextAuthorizer

Last updated 1 year ago