Skip to content

CyZeTLC/secure-rest-api-php-ts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple REST API with CSRF Protection (PHP + TypeScript)

Features

  • CSRF Protection with session-based tokens
  • Type-safe API client (TypeScript)
  • Automatic token refresh
  • Clean API routing

Examples

const api = new ApiService("http://localhost:8000/api");

const data = await api.request("/hello");
console.log(data.message);
const api = new ApiService("http://localhost:8000/api");

const result = await api.request<{ received: any }>("/data", {
  method: "POST",
  body: JSON.stringify({
    name: "Max M.",
    age: 25
  })
});
console.log(result);

About

A minimal secure REST API in PHP with CSRF protection and a TypeScript client. (beta release)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors