Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/TimonLukas/action-static-redbean
Create a single-file cross-platform server within an executable ZIP, powered by redbean 🦞
https://github.com/TimonLukas/action-static-redbean
actions cosmopolitan cosmopolitan-libc redbean server static
Last synced: about 2 months ago
JSON representation
Create a single-file cross-platform server within an executable ZIP, powered by redbean 🦞
- Host: GitHub
- URL: https://github.com/TimonLukas/action-static-redbean
- Owner: TimonLukas
- License: mit
- Created: 2022-06-18T18:04:13.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-12-05T21:46:49.000Z (about 1 year ago)
- Last Synced: 2024-10-12T17:18:25.092Z (3 months ago)
- Topics: actions, cosmopolitan, cosmopolitan-libc, redbean, server, static
- Homepage: https://github.com/marketplace/actions/create-static-redbean-server
- Size: 15.6 KB
- Stars: 15
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-cosmopolitan - action-static-redbean - GitHub action that creates a redbean (Redbean / Projects)
README
# Create static server executable - powered by redbean 🦞
[![license badge](https://img.shields.io/github/license/TimonLukas/action-static-redbean)](/LICENSE)
[![version badge](https://img.shields.io/github/v/release/TimonLukas/action-static-redbean)](https://github.com/TimonLukas/action-static-redbean/releases)
[![release date badge](https://img.shields.io/github/release-date/TimonLukas/action-static-redbean)](https://github.com/TimonLukas/action-static-redbean/releases)
[![issues badge](https://img.shields.io/github/issues-raw/TimonLukas/action-static-redbean)](https://github.com/TimonLukas/action-static-redbean/issues)This GitHub action creates a single-file server that:
* runs anywhere (see [jart/cosmopolitan](https://github.com/jart/cosmopolitan))
* serves static files (with optional fallback)
* is extensible through an extensive [scripting interface](https://redbean.dev/#lua)## Usage
```yaml
- uses: TimonLukas/action-static-redbean@v1
with:
# specifies version to be fetched from redbean.dev
version: "latest"
# Location of the finished executable
executable-name: "redbean.com"
# Location of static files to include
input: "dist"
# Fallback file (for history API-based routing), `false` to disable
fallback: "index.html"
# On launch, open the users preferred browser pointing to this path, `false` to disable
launch: "/"
# Cache redbean executable instead of fetching every time, `false` to disable
cache: true# Example: static server for `./build/*` without fallback using redbean version x.y.z
- uses: TimonLukas/action-static-redbean@v1
with:
version: "x.y.z"
input: "build"
fallback: false
- run: mv ./redbean.com $FOO
```## Extending behavior
Generally, anything beyond serving files statically can be approached using the LUA api. The fallback option itself is actually implemented as:```lua
function OnHttpRequest()
if not RoutePath() then
ServeAsset('$FALLBACK')
end
end
```To add any behavior, add `.init.lua` with your own content into your `input` directory.
Depending on your project it might be worth to look into frameworks for redbean like [`fullmoon`](https://github.com/pkulchenko/fullmoon).