ユーザ用ツール

サイト用ツール


node.js:jsonserver

差分

この文書の現在のバージョンと選択したバージョンの差分を表示します。

この比較画面にリンクする

両方とも前のリビジョン 前のリビジョン
次のリビジョン
前のリビジョン
node.js:jsonserver [2019/12/05 01:03]
ips
node.js:jsonserver [2019/12/31 08:07] (現在)
ips ↷ node:jsonserver から node.js:jsonserver へページを移動しました。
ライン 14: ライン 14:
  
 ==== 2.グローバルインストール ==== ==== 2.グローバルインストール ====
 +もしグローバルインストールでなければnode_modules/​.bin/​ にあるモジュールを実行する...面倒です。
 <code bash> <code bash>
 $ npm install -g json-server $ npm install -g json-server
ライン 60: ライン 61:
  
 === 6.アクセス === === 6.アクセス ===
 +
 +<​code>​
 +// http://​localhost:​3000
 +// スタートアップ画面
 +
 +Congrats!
 +You're successfully running JSON Server
 +✧*。٩(ˊᗜˋ*)و✧*。
  
 </​code>​ </​code>​
  
-{{:node:pasted:20191205-001025.png}}+<​code>​ 
 +// http://localhost:3000/​users 
 +
 +  { 
 +    "​id"​1, 
 +    "​name":​ "​safa"​ 
 +  ​}
 +  { 
 +    "​id":​ 2, 
 +    "​name":​ "​hana"​ 
 +  ​} 
 +
 +</​code>​
  
-{{:node:pasted:20191205-001249.png}}+<​code>​ 
 +// http://​localhost:​3000/​users/​2 
 +// routesで設定しているので /​users/?​id=2 となる 
 +{ 
 +    "/​users/​:id""/​users/?​id=:id" 
 +  ​}
  
 +</​code>​
  
  
node.js/jsonserver.1575475431.txt.gz · 最終更新: 2019/12/05 01:03 by ips