Skip to content
Gabriel Simmer edited this page Apr 24, 2020 · 2 revisions

Most of Sliproad's focus is API-first, with the frontend being a personal implementation for ease-of-access.

File & Providers API

Schemas

Directory

Files contains a collection of File data.

{
 "Path":"string",
 "Files":[]
}

File data

IsDirectory will be true or false.

{
 "IsDirectory": false,
 "Name":"README.md",
 "Extension":"md"
}

Providers

["provider"]

Endpoints

GET /api/providers

Fetches a list of valid providers that have been configured.

curl http://localhost:3000/api/providers

GET POST /api/files/{provider}

GET fetches the contents of the "root" directory for the provider.

curl http://localhost:3000/api/files/disk

POST data will attempt to be parsed as a multipart form, looking for a file: field containg the file in question.

curl -X POST -F file=@file.txt http://localhost:3000/api/files/disk

GET POST /api/files/{provider}/{directory/filename}

GET fetches the contents of the directory or the file contents when possible.

curl http://localhost:3000/api/files/disk/Documents

POST data will attempt to be parsed as a multipart form, looking for a file: field containg the file in question.

curl -X POST -F file=@file.txt http://localhost:3000/api/files/disk/Documents

Authentication API

GET POST /api/auth/callback

Used as a callback for authentication providers. GET will produce JavaScript for creating a POST request back to the endpoint, which will then set a JWT token as an HTTP-only cookie.

Clone this wiki locally