Skip to content

Commit

Permalink
add examples
Browse files Browse the repository at this point in the history
  • Loading branch information
thewilloftheshadow committed Apr 18, 2024
1 parent 9e565aa commit 29e0aee
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions packages/carbon/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,34 @@ npx create-carbon-app my-carbon-app
- [Documentation](https://carbon.buape.com/docs)
- [Discord](https://go.buape.com/Discord)
- [NPM](https://www.npmjs.com/package/@buape/carbon)


## Examples

### Cloudflare

```ts
import { Client } from "carbon"

const client = new Client()

export default {...client.router}
```

### NodeJS

```ts
import { Client } from "carbon"
import { serve } from "@carbonjs/nodejs"

const client = new Client(
{
clientId: process.env.CLIENT_ID!,
publicKey: process.env.PUBLIC_KEY!,
token: process.env.DISCORD_TOKEN!
},
[new PingCommand()]
)

serve(client, { port: 3000 })
```

0 comments on commit 29e0aee

Please sign in to comment.