https://github.com/whiletruu/elm-server-playground
Playground for server generating, running tasks, returning data to FE
https://github.com/whiletruu/elm-server-playground
Last synced: about 1 month ago
JSON representation
Playground for server generating, running tasks, returning data to FE
- Host: GitHub
- URL: https://github.com/whiletruu/elm-server-playground
- Owner: WhileTruu
- Created: 2023-05-29T17:59:21.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-05-30T04:05:34.000Z (about 3 years ago)
- Last Synced: 2025-02-23T06:29:42.973Z (over 1 year ago)
- Language: Elm
- Size: 36.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Elm server pages (or something)
The idea is for page configs to include tasks for resolving flags, extract the
instructions for how to do those tasks, then do those tasks on the server and
include the data as a variable in the served html file.
1. Page config includes a ResolverTask - the task to be resolved
2. Elm codegen creates an elm worker which outputs a stringified description of
the task to be resolved for each page via a port
3. The build bash script wraps the worker in a js file, runs it and writes the
output to a file.
The server serving the html files can then do the task(s) and provide the page
with the data via flags. Alternatively it could be turned into a CGI type thing.
# Build
```bash
bash ./build.sh dev
```
```bash
bash ./build.sh prod
```
# Run
```bash
node server.mjs
```