Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lukewilliamboswell/roc-serverless
https://github.com/lukewilliamboswell/roc-serverless
Last synced: 8 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/lukewilliamboswell/roc-serverless
- Owner: lukewilliamboswell
- Created: 2023-04-25T07:56:39.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-11-09T23:41:47.000Z (about 1 year ago)
- Last Synced: 2024-04-19T19:02:11.981Z (7 months ago)
- Language: Zig
- Size: 253 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- roc-awesome - lukewilliamboswell/roc-serverless
README
# Roc platform for Serverless Functions
Experimental platform to build serverless functions using Roc.
```
roc build --target=wasm32 examples/echo.roc
wasmer run examples/echo.wasm
```## CloudFare Notes
Cloudfare Workers are easy to get started and have a generous Free tier. Below is an example of how to setup a worker using the Cloudfare Wrangler cli.
```
# Install wrangler
npm install -g wrangler# Login to Cloudfare account
npx wrangler@wasm login# Publish worker - note if you haven't already you need to register a workers.dev subdomain before publishing to workers.dev
npx wrangler@wasm publish --name application-json --compatibility-date 2023-03-28 examples/application_json.wasm# Test worker
% curl -X POST https://application-json.[YOUR WORKER SUBDOMAIN].workers.dev
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8{"Image":{"Animated":false,"Height":600,"Ids":[116,943,234,38793],"Thumbnail":{"Height":125,"Url":"http:\/\/www.example.com\/image\/481989943","Width":100},"Title":"View from 15th Floor","Width":800}}%
```