[Server]vscodeでjsonサーバーインストール、起動、postmanツールでリクエスト

vscodeでjsonサーバーインストール

Viewタブ > Terminal

PS C:\xx> npm install -g json-server

added 340 packages in 10s

107 packages are looking for funding
  run `npm fund` for details

PS C:\xx> npm install

added xx packages, and audited xx packages in 13s

xx packages are looking for funding
  run `npm fund` for details

found 0 xx

jsonサーバー起動

Viewタブ > Terminal

PS C:\xx> npm run local

> xx@1.0.0 local
> json-server ./data/db.json --config json-server_local.json


  \{^_^}/ hi!

  Loading ./data/db.json
  Loading routes.json
  Done

  Resources
  http://localhost:3000/api-auth

  Other routes
  /api/auth* -> /api-auth$1

  Home
  http://localhost:3000

  Type s + enter at any time to create a snapshot of the database
  Watching...

postmanツールでリクエスト

POST

http://localhost:3000/api/xx

BODY raw {}

{
    "xx": {
        "xx": {
            "xx": {
                "content-type": "text/plain",
                "user-agent": "PostmanRuntime/x.xx",
                "accept": "*/*",
                "postman-token": "xx",
                "host": "localhost:3000",
                "accept-encoding": "xx",
                "connection": "keep-alive",
                "content-length": "2"
            }
        }
    }
}

投稿者: kinkun

保有資格 Salesforce Certified Platform App Builder T Salesforce Certified Platform Developer I Salesforce Certified Platform Developer II Salesforce Certified Administrator

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です