This section details the core operations of the app, specifically the backend. The backend exposes various REST API endpoints which can serve different types of requests related to markdown files. Below we detail each of them.
This document provides an overview of the API endpoints for the Marco Polo’s application. The application is built using SvelteKit for the backend API and PocketBase for the database. A Python package is also used to expose a CLI for uploading files to the server.
Endpoint: /api/upload Method: POST
file
: The markdown file to be uploaded.url
: Absolute path of file from root of vault.Refer Markdown Rendering
/api/ls
200 OK
: Returns a JSON response with the file tree.500 Internal Server Error
: Error in processing the request./api/search
query
: The search query string.200 OK
: Returns search results with snippets containing matches.404 Not Found
: No matches found./api/links
url
: The URL of the markdown file.200 OK
: Returns forward and backward links.404 Not Found
: File not found./api/backlinks
url
: The URL of the markdown file.200 OK
: Returns backlinks.404 Not Found
: File not found./api/image
url
: The URL of the image file.200 OK
: Returns the image file.404 Not Found
: Image not found.