1 | ![logo](comet_logo.png)
|
2 |
|
3 | <p align="center">
|
4 | ☄️ A powerful DX-first routing library for <a href="https://workers.cloudflare.com/">Cloudflare Workers</a>.
|
5 | </p>
|
6 |
|
7 | <p align="center">
|
8 | <a href="https://npmjs.org/package/@neoaren/comet"><img src="https://badgen.net/npm/v/@neoaren/comet" alt="NPM Version"></a>
|
9 | <a href="https://packagephobia.com/result?p=@neoaren/comet"><img src="https://badgen.net/packagephobia/install/@neoaren/comet" alt="NPM Install Size"></a>
|
10 | <a href="https://npmcharts.com/compare/@neoaren/comet?minimal=true"><img src="https://badgen.net/npm/dm/@neoaren/comet" alt="NPM Downloads"></a>
|
11 | </p>
|
12 |
|
13 | -----
|
14 |
|
15 | ## Getting started
|
16 |
|
17 | ```ts
|
18 | import { GET, server } from '@neoaren/comet'
|
19 |
|
20 | const comet = server()
|
21 |
|
22 | comet.route({ pathname: '/api/test/:id', method: GET }, async ({ event }) => {
|
23 | // Business logic
|
24 | return event.reply.ok({ id: event.params.id })
|
25 | })
|
26 |
|
27 | export default <ExportedHandler>{
|
28 | fetch: comet.handler
|
29 | }
|
30 | ```
|
31 |
|
32 | ## Documentation
|
33 | A proper documentation for Comet is work in progress.
|
34 |
|
35 | ## Contribution guide
|
36 | Use commit names with the following prefixes to indicate their purpose
|
37 |
|
38 | | Emoji | Prefix | Description |
|
39 | |--------------------------|----------------------------|------------------------------------------------------------|
|
40 | | :zap: :zap: | `:zap: :zap:` | for implementing breaking functionality (semver major) |
|
41 | | :zap: | `:zap:` | for implementing non-breaking functionality (semver minor) |
|
42 | | :hammer: | `:hammer:` | for bug fixes and non-breaking improvements (semver patch) |
|
43 | | :wrench: | `:wrench:` | for configurations |
|
44 | | :vertical_traffic_light: | `:vertical_traffic_light:` | for tests |
|
45 | | :memo: | `:memo:` | for documentations |
|
46 | | :mag: | `:mag:` | for lint fixes |
|
47 | | :recycle: | `:recycle:` | for non-breaking refactoring |
|
48 | | :paperclip: | `:paperclip:` | for dependencies |
|
49 | | :octocat: | `:octocat:` | for workflows |
|
50 | | :construction: | `:construction:` | for experimental or temporary changes |
|