Test http handler

Evgeny PisemskySat Jul 19 11:45:01+0300 2025

9fca60a

guile-pastebin
namelast commitdate
LICENSES/Reorganize code to ease packagingSat Feb 22 09:30:00+0300 2025
README.mdConstrain urlsSun Feb 23 11:45:15+0300 2025
modules/Fix ordering of pastesSat Jul 12 16:00:50+0300 2025
runFix ordering of pastesSat Jul 12 16:00:50+0300 2025
scripts/Reorganize code to ease packagingSat Feb 22 09:30:00+0300 2025
tests/Test http handlerSat Jul 19 11:45:01+0300 2025

README.md

<!-- SPDX-FileCopyrightText: 2021 Li Ian-Xue (b4283) b4283@pm.me SPDX-FileCopyrightText: 2025 Evgeny Pisemsky mail@pisemsky.site

SPDX-License-Identifier: GPL-3.0-only -->

guile-pastebin

A very simple pastebin written in Guile Scheme.

How to run

Execute one of the following commands in the root of repository:

guile -L modules scripts/pastebin [OPTIONS] <DATA_DIR>
GUILE_LOAD_PATH=modules scripts/pastebin [OPTIONS] <DATA_DIR>

Then navigate your web browser at http://localhost:8080. By default, pastebin listens on all IPv4 addresses (0.0.0.0) and runs on port 8080. These can be changed by passing the command line options --addr and --port, respectively.

<DATA_DIR> is a writable filesystem location you want to use to store pastes. If it doesn't exist, it will be created.

It was tested on Guile 3.0.9. Many thanks to the Guile development team for such great software.

API

Paste a file from command line

Paste a text file from command line and get a URL back: curl -F "text=<helloworld.cs" -F showUrl=1 http://localhost:8080/post

Notice the double-quotes around the parameters because < means IO redirection in sh.