diff options
author | 2022-07-13 22:40:29 +0200 | |
---|---|---|
committer | 2022-07-13 22:40:29 +0200 | |
commit | 8e9042142c5ee31163dd8839e5684da08cf3b687 (patch) | |
tree | f705ab9cfbb0d07997c363f1420d2b5637438964 /examples | |
parent | 5a2425d58549ff4653e9e68fd093cf5034def166 (diff) | |
download | bun-8e9042142c5ee31163dd8839e5684da08cf3b687.tar.gz bun-8e9042142c5ee31163dd8839e5684da08cf3b687.tar.zst bun-8e9042142c5ee31163dd8839e5684da08cf3b687.zip |
docs: Add bun-bakery template (#649)
Diffstat (limited to 'examples')
-rw-r--r-- | examples/bun-bakery/.gitignore | 42 | ||||
-rw-r--r-- | examples/bun-bakery/assets/bunbakery.png | bin | 0 -> 19513 bytes | |||
-rw-r--r-- | examples/bun-bakery/main.ts | 8 | ||||
-rw-r--r-- | examples/bun-bakery/package.json | 7 | ||||
-rw-r--r-- | examples/bun-bakery/routes/index.ts | 5 | ||||
-rw-r--r-- | examples/bun-bakery/tsconfig.json | 7 |
6 files changed, 69 insertions, 0 deletions
diff --git a/examples/bun-bakery/.gitignore b/examples/bun-bakery/.gitignore new file mode 100644 index 000000000..87e56100f --- /dev/null +++ b/examples/bun-bakery/.gitignore @@ -0,0 +1,42 @@ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +/node_modules +/.pnp +.pnp.js + +# testing +/coverage + +# next.js +/.next/ +/out/ + +# production +/build + +# misc +.DS_Store +*.pem + +# debug +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# local env files +.env.local +.env.development.local +.env.test.local +.env.production.local + +# vercel +.vercel + +**/*.trace +**/*.zip +**/*.tar.gz +**/*.tgz +**/*.log +package-lock.json +**/*.bun
\ No newline at end of file diff --git a/examples/bun-bakery/assets/bunbakery.png b/examples/bun-bakery/assets/bunbakery.png Binary files differnew file mode 100644 index 000000000..fad02d90e --- /dev/null +++ b/examples/bun-bakery/assets/bunbakery.png diff --git a/examples/bun-bakery/main.ts b/examples/bun-bakery/main.ts new file mode 100644 index 000000000..432c08208 --- /dev/null +++ b/examples/bun-bakery/main.ts @@ -0,0 +1,8 @@ +import {Router} from "@kapsonfire/bun-bakery" + + +new Router({ + port: 3000, + assetsPath: import.meta.dir + '/assets/', + routesPath: import.meta.dir + '/routes/' +})
\ No newline at end of file diff --git a/examples/bun-bakery/package.json b/examples/bun-bakery/package.json new file mode 100644 index 000000000..09adae1b0 --- /dev/null +++ b/examples/bun-bakery/package.json @@ -0,0 +1,7 @@ +{ + "version": "1.0.0", + "name": "@bun-examples/bun-bakery", + "dependencies": { + "@kapsonfire/bun-bakery": "^0.2.0" + } +} diff --git a/examples/bun-bakery/routes/index.ts b/examples/bun-bakery/routes/index.ts new file mode 100644 index 000000000..1b93d5dbe --- /dev/null +++ b/examples/bun-bakery/routes/index.ts @@ -0,0 +1,5 @@ +import {Context} from "@kapsonfire/bun-bakery" + +export async function GET(ctx: Context) { + ctx.sendHTML('<img src="/assets/bunbakery.png"><h1>Hello World!</h1>'); +}
\ No newline at end of file diff --git a/examples/bun-bakery/tsconfig.json b/examples/bun-bakery/tsconfig.json new file mode 100644 index 000000000..311824a28 --- /dev/null +++ b/examples/bun-bakery/tsconfig.json @@ -0,0 +1,7 @@ +{ + "compilerOptions": { + "types": ["bun-types"], + "module": "esnext", + "moduleResolution": "Node" + } +}
\ No newline at end of file |