Steph pfp
Steph
@assydcrypto
Tip of the day #20 - Want a fresh Co(o)rs ? Do you know how simple is it to handle CORS (Cross-Origin Resource Sharing) from a NestJS server ? Sometimes ago I struggled with cross origin problems between my NestJS server and the client side which spit out a lot of CORS errors when running Wasm programs trying to access foreign resources from the client side. I found it that simple to handle, just enable CORS in NestJS like this : In the boostrap() function of your main.ts, after you instantiated your App with NestFactory, just add : « app.enableCors(); » Have fun, stay safe and be nice until next time, cheers ! 🤘🏼🍻 #javascript #Node #nestjs @nestframework
0 reply
0 recast
0 reaction