fruitcake / laravel-cors

Adds CORS (Cross-Origin Resource Sharing) headers support in your Laravel application
MIT License
6.27k stars 613 forks source link

Paths Configuration #518

Closed RobTables closed 3 years ago

RobTables commented 3 years ago

I am not sure if I am setting my paths correctly.

Lets say I have an api api.domain.test. From this api we can request

api.domain.test/blog

api.domain.test/blog/{post}

api.domain.test/contact

I have tried to use paths such as blog, blog/, '/blog, etc but the only pattern that seems to work is having something like*/blog`

Is this how it is supposed to be done? The example api/* led me to believe blog/* would work.

RobTables commented 3 years ago

Not sure if I can add a label but this is a Question

barryvdh commented 3 years ago

It should.

RobTables commented 3 years ago

Although I closed this issue a while ago I wanted to share what I realized I was doing by mistake.

The API I created was versioned and each endpoint was prefixed with the version

api.example.test/v1/blog

Therefore in my paths configuration I needed to enter

v1/blog/*