Wow just great
I'd like to have a mantor like you !
Congrats on your first long-form article :)
thank you! Took me much long than anticipated haha
It's alright I always take a much longer time to write technical articles.
Nice and Good Explaination..!
Can you please tell me what next? i would like to upload this Api to website for-example: example.com/api/posts instead of localhost:3000/posts
how can i do that?
How can I solve a Corss origin?, I'm calling localhost:3000/subscribers/ endpoint through react application which is running on localhost:3001
Hi, Vicente ! You can solve cross origin setting a header in your server definition.
res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
But if you want you can delegate that to a lib called "cors" that you can install: github.com/expressjs/cors#installa...
And that you can use simply by calling it as a Middleware.
var express = require('express')
var cors = require('cors')
var app = express()
It is important to remember that allowing cors without specifying a known domain could be dangerous since anyone would be able to reach your api, be careful and if you have any questions don't hesitate to ask :)
saludos, paisano !
Hey thanks man for some reason I was missing put my domain there, but now it's work fine.
Gracias por el support carnal =).
Was a great guide for a beginner
Liked it lot <3
I love this article, great job!
Found a small error in the catch for the update subscriber, it's missing the (err) parameter part.
Thanks for article, I was test your code it really work great!
Awesome! Glad it was useful :)
Thank you very much.This is the easy-to-follow blogs for beginner like me.I really enjoy it.Keep doing ! :)
Great tutorial! May I know how or where can I deploy this API?
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.