My Json Server (정말 간단하게 API서버 만들기)
1. json server를 이용해서 데이터(db.json)를 만든다.
https://www.npmjs.com/package/json-server
json-server
Get a full fake REST API with zero coding in less than 30 seconds
www.npmjs.com
2. 전용 Github Repository를 하나 만들어서 db.json을 올린다 (Read.me는 만들어 두자)
3. 이하의 사이트에 있는 깃헙연동하는 방법을 본다.(URL에 /깃헙아이디/레포지터리이름 을 쓰면 그게 API서버가 된다.)
https://my-json-server.typicode.com/
My JSON Server - Fake online REST server for teams
my-json-server.typicode.com/user/repo/posts/1 { "id": 1, "title": "hello" }
my-json-server.typicode.com
결과
https://my-json-server.typicode.com/gmldnjs26/json-server-api
My JSON Server - Fake online REST server for teams
Available resources You can use GET, POST, PUT, PATCH and DELETE. Changes aren't persisted between calls. Source https://github.com/gmldnjs26/json-server-api/blob/[main|master]/db.json
my-json-server.typicode.com