{"id":13734812,"url":"https://github.com/ento/worker-haskell-template","last_synced_at":"2025-05-08T11:31:10.269Z","repository":{"id":44017654,"uuid":"231995361","full_name":"ento/worker-haskell-template","owner":"ento","description":"Wrangler template for a Cloudflare Workers + Haskell (Asterius) project","archived":true,"fork":false,"pushed_at":"2022-02-12T22:09:14.000Z","size":761,"stargazers_count":5,"open_issues_count":9,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-08-04T03:04:08.356Z","etag":null,"topics":["asterius","cloudflare-workers","haskell"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"0bsd","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ento.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-01-06T00:34:10.000Z","updated_at":"2023-01-28T02:45:59.000Z","dependencies_parsed_at":"2022-07-21T01:32:19.021Z","dependency_job_id":null,"html_url":"https://github.com/ento/worker-haskell-template","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ento%2Fworker-haskell-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ento%2Fworker-haskell-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ento%2Fworker-haskell-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ento%2Fworker-haskell-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ento","download_url":"https://codeload.github.com/ento/worker-haskell-template/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224727121,"owners_count":17359530,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["asterius","cloudflare-workers","haskell"],"created_at":"2024-08-03T03:01:00.179Z","updated_at":"2024-11-15T03:31:10.768Z","avatar_url":"https://github.com/ento.png","language":"JavaScript","funding_links":[],"categories":["Msc"],"sub_categories":[],"readme":"# worker-haskell-template\n\nA [`wrangler`][wrangler] template for a Cloudflare Workers project with [Asterius][asterius], a Haskell to WebAssembly compiler.\n\n- [`src/worker.mjs`](src/worker.mjs) is the 'entry' module that defines the `fetch` event listener and loads the Asterius runtime.\n- [`src/worker.hs`](src/worker.hs) implements the actual request handling code in Haskell.\n- [`webpack.config.js`](webpack.config.js) holds the webpack config that integrates the Asterius build process nicely with Wrangler.\n\nAs Asterius is in the alpha development stage, this template may become outdated at any time.\n\n## Prerequisites\n\n* [Node.js](https://nodejs.org/) (tested with 13.x)\n* [Docker](https://docs.docker.com/install/) for running the Asterius compiler [provided as a Docker image][asterius-image]\n\n## Usage\n\n1. Generate a project with wrangler if you have it installed in your system:\n\n   ```\n   wrangler generate myworker https://github.com/ento/worker-haskell-template\n   ```\n\n   If not, either clone this repo or download its archive from GitHub and unarchive locally.\n\n1. Install dependencies:\n\n   ```\n   cd myworker\n   npm install\n   ```\n\n1. Edit [`wrangler.toml`][wrangler-config] and replace the `account_id` value with your Cloudflare account ID.\n\n   If you didn't use wrangler to generate the project, replace the `name` value as well.\n\n   For more information, including how to deploy to your Cloudflare Zone, see [Cloudflare's documentation][quickstart-config].\n\n1. Build and test:\n\n   ```\n   npm run build\n   npm run test\n   ```\n\n1. Preview with:\n\n   ```\n   npx wrangler preview\n   ```\n\n   You should see \"Hello from Haskell\" in response to `GET` requests.\n   Send a `POST` request with a body like `{\"name\": \"world\"}` to get\n   \"Hello world\" in return.\n\n1. Publish:\n\n   ```\n   npx wrangler publish\n   ```\n\n[asterius]: https://github.com/tweag/asterius\n[asterius-image]: https://hub.docker.com/r/terrorjack/asterius\n[quickstart-config]: https://developers.cloudflare.com/workers/quickstart/#configure\n[wrangler]: https://github.com/cloudflare/wrangler\n[wrangler-config]: https://developers.cloudflare.com/workers/tooling/wrangler/configuration/#per-project\n\n---\n\nThis template is licensed under the terms of the 0BSD license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fento%2Fworker-haskell-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fento%2Fworker-haskell-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fento%2Fworker-haskell-template/lists"}