ng serve
を使用した時にCORSの制約でAPIが叩けないときの対策をメモ。。。
json形式で以下のファイルを作成する。
proxy-config.json
{
"/api": {
"secure": false,
"target": "http://localhost:8080"
}
}
で、
ng serve --proxy-config proxy.conf.json
を実行。
Angular Cli便利やね〜
More than 5 years have passed since last update.
ng serve
を使用した時にCORSの制約でAPIが叩けないときの対策をメモ。。。
json形式で以下のファイルを作成する。
{
"/api": {
"secure": false,
"target": "http://localhost:8080"
}
}
で、
ng serve --proxy-config proxy.conf.json
を実行。
Angular Cli便利やね〜
Register as a new user and use Qiita more conveniently