Clonar (HTTPS)
git clone https://github.com/samuelikz/fakeapi.git
cd fakeapi
CRUD, persistência em JSON, busca, filtros, paginação e CORS. Ideal para simular back-end enquanto o serviço real não existe.
git clone https://github.com/samuelikz/fakeapi.git
npm install
cp env.example .env
npm start
git clone https://github.com/samuelikz/fakeapi.git
cd fakeapi
npm install
cp env.example .env # ajuste as variáveis conforme necessário
npm run dev # http://localhost:8000
# ou, em produção:
npm run build
npm start
GET /health
— saúde básicaGET /health/detailed
— saúde detalhadaGET /posts
— lista recurso padrãoPOST /posts
— cria itemURL base padrão: http://localhost:8000
(ajuste PORT
no .env
se quiser outra porta).
curl -s http://localhost:8000/health | jq
curl -s http://localhost:8000/posts | jq
curl -s http://localhost:8000/posts/1 | jq
curl -s -X POST http://localhost:8000/posts \
-H 'Content-Type: application/json' \
-d '{"title":"Bem-vindo à Fake API","content":"Esta é uma API RESTful completa com arquitetura limpa e separação de responsabilidades.","author":"Samuel","tags":["api","rest","nodejs"]}' \
| jq
src/
├─ config/ # app & database config
├─ controllers/ # health, resource, system
├─ middleware/ # cors, logger, validation
├─ routes/ # health, resource, system
├─ services/ # database service
├─ utils/ # file utils
└─ server.js # bootstrap da aplicação
/:resource
/health
, /health/detailed
, /health/ready
, /health/live
/_docs
— documentação embutida/__resources
— recursos disponíveis + contagem/_ensure/:resource
— cria recurso se não existir