devtools - How can I override the root and sub-path in Chrome Overrides? - Stack Overflow

My app sends requests to the backend for bothappapiprojects`andappapiprojects:projectIdUsing C

My app sends requests to the backend for both

/app/api/projects`

and

/app/api/projects/:projectId

Using Chrome devtools, I would like to override both calls to return my own list from /projects and a custom objects from /projects/1 (where 1 is the project ID).

Seemingly, I am only able to do one of them, but not both:

If I override /projects first, Devtools creates an override file called projects under app/api. Trying to override /projects/1 next creates a weird file in the Page sources tab and does not go to overrides.

Doing the reverse, creates an override file named 1 under app/api/projects and a weird file under Page sources for the other one.

It literally either or, but not both!

I tried creating a "root" override file under app/api/projects as a sibling to 1 but Devtools won't let me call it anything resembeling an expected name (/, . etc.).

I cannot have both a file and a directory named projects because they conflict.

There is nothing online on this.

What I expect to happen: Be able to override both endpoints.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745091617a4610725.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信