Skip to content

improve dev env steps and fix bun run dev experience #1100

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,13 @@ The Elysia.js repo is using [bun](https://bun.sh). Make sure you have the [lates

1. Clone this repository

2. In the root of this project, run `bun install` to install all of the necessary dependencies
2. In the root of this project, run `bun install` to install dependencies

3. To run the development version, run `bun run dev`
3. Run `bun test` to run unit tests

4. (optional) Run `bun build` to locally build files and `bun run test` to run a full test

5. Run `bun run dev` to start an example application :fox_face:

### Unit Testing

Expand Down
15 changes: 9 additions & 6 deletions example/a.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
import { Elysia, error, t } from '../src'
import { Elysia, t } from '../src'
import { req } from '../test/utils'

const app = new Elysia().get(
'/',
() => {
return {
name: 'a',
a: 'b'
message: 'Hello World!'
}
},
{
response: t.Object({
name: t.String()
message: t.String()
})
}
)

app.handle(req('/'))
.then((x) => x.json())
app.listen(3000, ({ hostname, port }) => {
console.log(`🦊 running at http://${hostname}:${port}`)
})
// Trigger the request
.handle(req('/'))
.then((res) => res.json())
.then(console.log)