Skip to content

Latest commit

 

History

History
39 lines (26 loc) · 1.02 KB

API.md

File metadata and controls

39 lines (26 loc) · 1.02 KB

Coneixements previs

No és imprescindible però també us pot ser interessant saber com està feta la API que utilitzarem. Com crear una API Laravel: Vídeos 124 i 125 de la serie casteaching, aplicació Laravel amb TDD:

Paquet NPM

Instal·lació:

npm install casteaching

Exemple d'ús:

import casteaching from 'casteaching'

// Obtenir llista de vídeos publicats
casteaching.videos()

// Obtenir vídeo per ID
casteaching.video.show(1)

// Crear video
casteaching.video.create({name: 'PHP 101', description: 'Bla bla bla',  url: 'https://youtube.com/...' })

// Update video
casteaching.video.update(1,{name: 'PHP 101', description: 'Bla bla bla',  url: 'https://youtube.com/...' })

// Destroy
casteaching.video.destroy(1)