Skip to content
This repository has been archived by the owner on Jan 11, 2024. It is now read-only.

cs8898/nitro_devproxy_mre

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

DEV Proxy Minimal Reproducable Example

MRE for unjs/nitro#1643

Problem

Nitro devProxy drops basepath of proxied server (only accepts Protocol, Host and Port of URL)

Config

{
    devProxy: {
        "/api": {
           target: "http://localhost:3001/api"
        }
    }
}

Expected

http://nitro:3000/api/foo => http://server:3001/api/foo

Observed

http://nitro:3000/api/foo => http://server:3001/foo

MRE

api_srv

Simple HTTP Server listening on 3001 responding with api_path: ${req.url}

httpxy_mre ✔️

Simple HTTP Server elevating httpxy to server /api via Proxy

nitor_mre ❌

Nitro stater sample, with devProxy

Changes

  1. add proxy2 to httpxy_mre
    • /foo as entrypoint
    • initialize directly on proxy creation (similar to nitro dev/server.ts)
  2. add /foo to nitro devProxy
  3. add /bar to httpxy_mre
    • acutally httpxy is ignoring the path
    • nitro is just dropping the path of the route

About

Nitro devProxy MRE

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published