Back to articles
PocketBase Has a Free API You Should Know About
How-ToTools

PocketBase Has a Free API You Should Know About

via Dev.toAlex Spinov

PocketBase is a single binary that gives you a full backend: REST API, realtime subscriptions, auth, file storage, and admin dashboard. Instant REST API Create a collection in the admin UI, and you immediately get full CRUD: # List records curl 'http://127.0.0.1:8090/api/collections/posts/records?page=1&perPage=20' # Create record curl -X POST 'http://127.0.0.1:8090/api/collections/posts/records' \ -H 'Content-Type: application/json' \ -d '{"title": "Hello World", "content": "My first post"}' # Update record curl -X PATCH 'http://127.0.0.1:8090/api/collections/posts/records/RECORD_ID' \ -d '{"title": "Updated Title"}' # Delete record curl -X DELETE 'http://127.0.0.1:8090/api/collections/posts/records/RECORD_ID' JavaScript SDK import PocketBase from ' pocketbase ' const pb = new PocketBase ( ' http://127.0.0.1:8090 ' ) // Auth await pb . collection ( ' users ' ). authWithPassword ( ' user@test.com ' , ' password ' ) // CRUD const posts = await pb . collection ( ' posts ' ). getFullList

Continue reading on Dev.to

Opens in a new tab

Read Full Article
6 views

Related Articles