Skip to content

Create paste api - #75

Open
tylerhwang333-glitch wants to merge 2 commits into
SCE-Development:devfrom
tylerhwang333-glitch:create-paste-api
Open

Create paste api#75
tylerhwang333-glitch wants to merge 2 commits into
SCE-Development:devfrom
tylerhwang333-glitch:create-paste-api

Conversation

@tylerhwang333-glitch

@tylerhwang333-glitch tylerhwang333-glitch commented Aug 6, 2026

Copy link
Copy Markdown

modules/sqlite_helpers.py

  • Added two new functions:
    • insert_text_paste(sqlite_file), inserts a default row into pastes, returns the new id (lastrowid), or None on error.
    • paste_exists(sqlite_file, paste_id), checks if a given id exists in pastes.
      server.py
  • Added imports: PlainTextResponse, pathlib.Path, os.
    id, writes the text to pastes/ on disk, returns {"id": paste_id}.
  • Added GET /paste/view/{paste_id}: reads pastes/<paste_id> from disk and returns it as plain text, 404 if missing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant