Skip to content

About

A vanilla JavaScript playground for REST APIs on JSONPlaceholder: load users, page through posts with _limit and _page, create, update (PATCH) and delete with Axios, and handle errors with async / await. A GoIT Full Stack learning project.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

8 Commits

Folders and files

Repository files navigation

REST API Playground — users load, posts page in five at a time, a post is shared, edited and deleted, and a network panel lists each request

Live JavaScript Axios License

A small app for practising REST APIs with real HTTP requests,
CRUD and pagination on JSONPlaceholder, with no framework at all.

What it practises

Three files (index.html, style.css, app.js) and one public API. Every button sends a real request through Axios, every response is rendered with plain DOM code, and every failure lands in a catch with a readable message instead of a silent console error.

Users "Kullanıcıları Getir" fetches /users and shows each name, email and company.
Posts Five posts load first; "Daha Fazla Yükle" asks for the next page with _limit and _page and appends it.
Create A small form shares a new post with POST /posts.
Update "Düzenle" changes a post with PATCH /posts/:id.
Delete "Sil" removes a post with DELETE /posts/:id.
Errors async / await with try / catch around every call, and a message when a request fails.

The requests

flowchart LR
  UI[index.html · buttons and form] --> APP[app.js · Axios instance]
  APP -- GET /users --> API[JSONPlaceholder]
  APP -- GET /posts?_limit=5&_page=n --> API
  APP -- POST /posts --> API
  APP -- PATCH /posts/:id --> API
  APP -- DELETE /posts/:id --> API
  API --> DOM[render cards · or show the error]
Loading

JSONPlaceholder answers writes with realistic responses but does not store them, so the page updates its own list after each successful call.

Türkçe özet

Bu mini proje, gerçek HTTP istekleriyle REST API kullanmayı pratik etmek için hazırlandı. JSONPlaceholder API'si üzerinde kullanıcıları listeleme, gönderileri beşer beşer sayfalayarak yükleme ve gönderi ekleme (POST), düzenleme (PATCH) ve silme (DELETE) işlemleri yapılıyor. Sorgu parametreleri, async / await ve hata yönetimi gösteriliyor. Framework yok; düz HTML, CSS ve JavaScript.

Running it

Open index.html in a browser, or serve the folder:

python3 -m http.server 8080

Built by kutluhangil MIT licensed · a learning project from the GoIT Full Stack programme · data from JSONPlaceholder.

About

A vanilla JavaScript playground for REST APIs on JSONPlaceholder: load users, page through posts with _limit and _page, create, update (PATCH) and delete with Axios, and handle errors with async / await. A GoIT Full Stack learning project.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages