DEV Community

Cover image for How to easily create and host your own REST API without writing a single line of code

How to easily create and host your own REST API without writing a single line of code

Yogesh Chavan on October 16, 2020

Introduction In this article, you will see how to easily create your own REST API server to be accessible on the internet without coding...
Collapse
 
shubhadip_bhowmik profile image
Shubhadip Bhowmik

Insightful

Collapse
 
myogeshchavan97 profile image
Yogesh Chavan

Glad to hear that. Thank you🙏

Collapse
 
shohagcsediu profile image
Mohammad Shohag

nice

Collapse
 
myogeshchavan97 profile image
Yogesh Chavan

Thank you 🙏

Collapse
 
liyasthomas profile image
Liyas Thomas

Feel free to use open source Postman alternative: Hoppscotch for testing APIs on-the-go directly from your browser window.

GitHub logo hoppscotch / hoppscotch

👽 Open source API development ecosystem - https://hoppscotch.io

Collapse
 
badasscoder profile image
Badasscoder • Edited

why postman needs an alternative. - before opening url
[ after opening url]

awesome. I don't need postman anymore. your app is web based. big thing it is written in vue js. that's why will use

Collapse
 
liyasthomas profile image
Liyas Thomas
Thread Thread
 
badasscoder profile image
Badasscoder

Really Amazing. Now I have an extension. Good bye postman. Welcome to Hoppscotch.

Thread Thread
 
badasscoder profile image
Badasscoder

hey. Your extension does not have support for edge

Collapse
 
vampiire profile image
Vamp

this is so slick. and i echo the others - crisp and clear writing man. thanks for writing this

Collapse
 
myogeshchavan97 profile image
Yogesh Chavan

Thank you so much :)

Collapse
 
steevn profile image
steevn

Thanks for the clear and simple explaination, Yogesh.

Collapse
 
myogeshchavan97 profile image
Yogesh Chavan

Thank you :)

Collapse
 
myogeshchavan97 profile image
Yogesh Chavan

You can use json-server for hosting your API on production as I did in this article here.

Collapse
 
amlana24 profile image
amlan

Is there a way to add auth to it?

Collapse
 
myogeshchavan97 profile image
Yogesh Chavan

yes, you can add authentication using middleware like this:

// server.js
const jsonServer = require('json-server')
const server = jsonServer.create()
const router = jsonServer.router('db.json')
const middlewares = jsonServer.defaults()

server.use(middlewares)
server.use(router)
server.listen(3000, () => {
  console.log('JSON Server is running')
})
Enter fullscreen mode Exit fullscreen mode
Collapse
 
eldrige profile image
Eldrige

Thanks, this was very beautiful

Collapse
 
myogeshchavan97 profile image
Yogesh Chavan

Thank you 🙂

Collapse
 
estebankra profile image
Esteban Krauwezuk

Thanks, very helpful.

Collapse
 
myogeshchavan97 profile image
Yogesh Chavan

Thank you :)

Collapse
 
mrexito profile image
Raul

Can you explain how one should proceed in case you have different json files. How could I choose one from them to show in my local server? thank you