Vueで簡単なアプリを作成するために必要となるJSONServerを立ち上げました。
ターミナルでnpm i json-serverを実行しインストール、サーバー用のディレクトリを作成してそこにjsonファイルを配置しました。
db.json
{
"todos":[
{
"id":1,
"text":"Vueのプログラミング",
"categoryId":1
},
{
"id":2,
"text":"寝る",
"categoryId":1
},
{
"id":3,
"text":"買い物",
"categoryId":2
}
],
"categories":[
{
"id":1,
"title":"未着手"
},
{
"id":2,
"title":"完了"
}
]
}
サーバー用のフォルダに移動し、ターミナルでnpx json-server --watch db.jsonを実行するとサーバーが立ち上がりました。
これからこの仕組みを使ってアプリを作っていきます。