Quando executei o comando json-server --watch db.json
o terminal retornava o seguinte:
PS B:\Renan\OneDrive\Documentos\Projetos Web\Alura\aluraplay-requisicoes-main> json-server --watch db.json
json-server: The term 'json-server' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
Consultei o Windows Copilot e ele explicou que isso significava que o json-server não estava instalado e me sugeriu instalá-lo com o comando npm install -g json-server
. Depois disso, tudo funcionou, então fica aí a dica!
PS B:\Renan\OneDrive\Documentos\Projetos Web\Alura\aluraplay-requisicoes-main> npm install json-server
up to date, audited 113 packages in 2s
13 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
PS B:\Renan\OneDrive\Documentos\Projetos Web\Alura\aluraplay-requisicoes-main> npm install -g json-server
added 112 packages in 7s
13 packages are looking for funding
PS B:\Renan\OneDrive\Documentos\Projetos Web\Alura\aluraplay-requisicoes-main> json-server --watch db.json
\{^_^}/ hi!
Loading db.json
Done
Resources
http://localhost:3000/videos
Home
http://localhost:3000
Type s + enter at any time to create a snapshot of the database
Watching...