How to enable CORS on Vapor API

Hi, Im trying to use my Vapor API with an angular web app, and the request it’s been blocked by CORS, any clue on how to enable it in vapor? thanks

@0xtim Can you please help with this when you get a chance? Thank you - much appreciated! :]

Check out https://docs.vapor.codes/3.0/vapor/middleware/#corsmiddleware

1 Like