https://github.com/boo-urns/cloudflare-worker-starter
https://github.com/boo-urns/cloudflare-worker-starter
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/boo-urns/cloudflare-worker-starter
- Owner: Boo-urns
- License: mit
- Created: 2025-01-21T19:29:50.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-04T19:55:02.000Z (over 1 year ago)
- Last Synced: 2025-03-04T20:35:08.949Z (over 1 year ago)
- Language: TypeScript
- Size: 63.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Cloudflare Worker Starter
## Overview
This project is a starter template for building applications using Cloudflare Workers. It leverages modern tools and practices to streamline development and deployment.
## Key Features
- **Conventional Commits**: We use conventional commits to maintain a clean and structured commit history. This helps in automating the versioning and changelog generation processes.
- **GitHub Actions**: Automated workflows are set up using GitHub Actions to deploy the Cloudflare Worker seamlessly. Every push to the main branch triggers a deployment, ensuring that the latest changes are always live.
- **Cloudflare Workers**: The core of this project is built on Cloudflare Workers, allowing you to run serverless applications at the edge, close to your users.
## Getting Started
1. **Clone the Repository**:
```bash
git clone https://github.com/Boo-urns/cloudflare-worker-starter.git
cd cloudflare-worker-starter
```
**Change Name**:
In the package.json change the name as well as in the wrangler.toml file
2. **Install Dependencies**:
We use PNPM for package management. Install it globally if you haven't already:
```bash
npm install -g pnpm
pnpm install
```
3. **Development**:
Start the development server:
```bash
pnpm dev
```
Open your browser at `http://localhost:8787` to see your worker in action.
4. **Deployment**:
Deploy your worker by creating a PR.
- Setup a couple variables in Github
- `CLOUDFLARE_API_TOKEN` and `CLOUDFLARE_ACCOUNT_ID` You should be able to create the API token for default workers setting in Cloudflare.
- `GH_TOKEN` push access to repo.
## ENV variables
Use both a .dev.vars file to use env variables locally and set those with wranger for your worker:
`npx wrangler secret put MY_VARIABLE_NAME`
## Additional Resources
- **Cloudflare Workers Documentation**: Learn more about building with Cloudflare Workers [here](https://developers.cloudflare.com/workers/).
- **Conventional Commits**: Understand the conventional commits specification [here](https://www.conventionalcommits.org/).
## Contributing
We welcome contributions! Please follow the conventional commit guidelines and ensure all tests pass before submitting a pull request.