swisspol / GCDWebServer

The #1 HTTP server for iOS, macOS & tvOS (also includes web based uploader & WebDAV server)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How do you add routes to individual files without 301 redirects?

fessehaye opened this issue · comments

Trying to used GCDWebserver for a React SPA. To handle the react router I would like three routes ("/" "route1/12343", "route2/23453") to all point to the bundled index.html. I have tried using addHandler and GCDWebServerDataResponse with redirects to address this but I lose old url when it redirects.

Is there anyway to do the redirect with a 200 status code instead?