Skip to content

patryk-lukasz-kacprowicz/api-skills

Repository files navigation

O projekcie

Projekt ma za zadanie pokazać umiejętności tworzenia API, oraz korzystania z zewnętrznego API poprzez serwis.

Instalacja

  1. Sklonuj repozytorium
  2. Użyj
    composer install
    npm install
    npm run dev
    
  3. Skopiuj i zmień nazwę pliku .env.example na .env
  4. Wprowadź poprawne dane do logowania z bazą w pliku .env
  5. Wykonaj
    php artisan migrate
    
    lub
    php artisan migrate --seed
    
  6. Skonfiguruj virtual host dla aplikacji!
  7. Do poprawnego działania zaplanowanych Jobów, należy uruchomić w tle dwie komendy
    php artisan queue:work
    
    oraz
    php artisan schedule:work
    

API


Do poprawnego działania API, zaleca się ustawienie w headers Accept na application/json

Endpoint Metoda Opis Dodatkowe
/api/posts
GET Zwraca liste wszystkich postów Paginacja
?page=X
/api/post/{post}
GET Zwraca dane wybranego postu -
/api/posts
POST Dodaje nowy post do bazy Wymagane
title: required|string|max:128,
content: required|string
author: required|string|max:128
/api/post/{post}
PUT Aktualizuje wybrany post Wymagane
title: required|string|max:128
content: required|string
author: required|string|max:128
/api/post/{post}
DELETE Usuwa wybrany post -
/api/comments
GET Zwraca liste wszystkich postów Paginacja
?page=X
/api/comment/{comment}
GET Zwraca dane wybranego komentarza -
/api/comments/{post}
POST Tworzy nowy komentarz dla wybranego postu Wymagane
content: required|string
author: required|string|max:128
/api/comment/{comment}
PUT Aktualizuje wybrany komentarz Wymagane
content: required|string
author: required|string|max:128
/api/comment/{comment}
DELETE Usuwa wybrany komentarz -

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors