linzhengen / tech-notes

My tech notes write in github issues🧲
1 stars 0 forks source link

[20200930] netlify.tomlでhttp apiへリダイレクト #8

Open linzhengen opened 4 years ago

linzhengen commented 4 years ago

SPA(netlify https) + http apiのデモページを作りたくて、netlify.tomlの設定でいい感じhttp apiをコールできました。

[[redirects]]
  from = "/api/*"
  to = "http://hoge.http.server/api/:splat"
  status = 200
  force = true
  headers = {X-From = "Netlify"}

参考URL

https://docs.netlify.com/configure-builds/file-based-configuration/#sample-file