Created
December 27, 2017 11:54
-
-
Save samonzeweb/3a932b342732d6fe9baa2255d41764cb to your computer and use it in GitHub Desktop.
Proxy API to avoid CORS problems during JS development
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Proxy API to avoid CORS problems during development : | |
# - Get Caddy from https://caddyserver.com/ | |
# - Put the Caddyfile somewhere with the Caddy executable | |
# - Change posts, paths, ... as needed | |
# - Start the Caddy process (without args) | |
# - Lauch the SPA using the URL http://localhost:8081 | |
localhost:8081 | |
log stderr | |
# First : the API | |
proxy /api http://myserver.foo.bar | |
# Last : the dev server started by npm, yarn, ... | |
proxy / localhost:8080 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment