Hey readers ππ», in this blog we are going to discuss about making our own API in just 30 lines of code.
Topics Covered :
What is an AP...
For further actions, you may consider blocking this person and/or reporting abuse
Hi Shreyas, I enjoyed the article. It was simple and to the point.
For the get request I think it would be better to use .json so that the response renders as JSON, like this:
res.status(200).json(products)
Thanks for sharingβ¦ I didnβt know this!!
you're welcome! Will you update the article?
It's shown here in the docs: expressjs.com/en/api.html#res.json
Yup I'll surely add this in it
Cool :)
If you'd like to spin up these APIs and test them β try an online API development / testing platform - we're building Hoppscotch.io.
GitHub:
hoppscotch / hoppscotch
π½ Open source API development ecosystem https://hoppscotch.io
Hey I have used this!! Have you guys tied up with Aviyel?
Yes we did. They're doing an amazing job on growing OSS β€οΈπ―.
Simple, good post ππΌ
When I query the endpoint (random-quote-generator-api.adamgon...) using fetch locally I get an cors error and then if I use mode 'no-cors', I get an opaque response. Is there any way around this? I've been trying to figure this out for several hours.
Good Work Shreyas and I find this very informative
Thanks bro
Thanks, very nice post.
Thanks bro
Hi! Maybe a stupid question, but where do i write the code from step 1? Do i need to create a file? What should the file-structure be? I don't understand :/
Hey Julia, first of all no quesitons are stupid xD! And you just have to create one file having a
.js
extension.Create a file let's say
index.js
and then write your code in it.Very useful!!
Thanks for sharing :)
Great article to quickly spin up an API to be able to focus more on devops afterwards like containerizing it, deploying it, and then scaling it.
great jobππ€
Thanks
Great work Shreyas , and it is so informative.
Thanks bro, more informative blogs coming soon!
Friend... there is a little typo , 27 x 7, I think it should be 24 x 7
Thanks a lot, I edited it.
Sweet and simple Express. Awesome!
Thanks ππ―
Thanks a lot very helpful article
Loved this one! Hoping to use my own API soon.
That's awesome!
Very clean and simple. Thank you.
Short and precise!
Thanks for sharing