rename project folder

This commit is contained in:
Michi 2025-09-08 20:17:41 +02:00
parent 09d1925cc0
commit 3c197d8ebe
9 changed files with 0 additions and 0 deletions

33
api/.gitignore vendored Normal file
View file

@ -0,0 +1,33 @@
# prod
dist/
# dev
.yarn/
!.yarn/releases
.vscode/*
!.vscode/launch.json
!.vscode/*.code-snippets
.idea/workspace.xml
.idea/usage.statistics.xml
.idea/shelf
# deps
node_modules/
.wrangler
# env
.env
.env.production
.dev.vars
# logs
logs/
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
# misc
.DS_Store

21
api/README.md Normal file
View file

@ -0,0 +1,21 @@
```txt
npm install
npm run dev
```
```txt
npm run deploy
```
[For generating/synchronizing types based on your Worker configuration run](https://developers.cloudflare.com/workers/wrangler/commands/#types):
```txt
npm run cf-typegen
```
Pass the `CloudflareBindings` as generics when instantiation `Hono`:
```ts
// src/index.ts
const app = new Hono<{ Bindings: CloudflareBindings }>()
```

1557
api/package-lock.json generated Normal file

File diff suppressed because it is too large Load diff

15
api/package.json Normal file
View file

@ -0,0 +1,15 @@
{
"name": "themepark-assistant",
"type": "module",
"scripts": {
"dev": "wrangler dev",
"deploy": "wrangler deploy --minify",
"cf-typegen": "wrangler types --env-interface CloudflareBindings"
},
"dependencies": {
"hono": "^4.9.6"
},
"devDependencies": {
"wrangler": "^4.4.0"
}
}

17
api/src/index.ts Normal file
View file

@ -0,0 +1,17 @@
import { Hono } from 'hono'
import { bearerAuth } from 'hono/bearer-auth'
import notification from './notification'
import logbook from './logbook'
// create app
const app = new Hono()
// add bearer authentication
const token = 'insecure-token'
app.use('/*', bearerAuth({ token }))
// define routes & export app
app.route('/notification', notification)
app.route('/logbook', logbook)
export default app

13
api/src/logbook.ts Normal file
View file

@ -0,0 +1,13 @@
import { Hono } from 'hono'
const app = new Hono()
app.get('/list', (c) => {
return c.json(
{
message: 'List all logbook entries'
}
)
})
export default app

13
api/src/notification.ts Normal file
View file

@ -0,0 +1,13 @@
import { Hono } from 'hono'
const app = new Hono()
app.get('/list', (c) => {
return c.json(
{
message: 'List all notification methods'
}
)
})
export default app

14
api/tsconfig.json Normal file
View file

@ -0,0 +1,14 @@
{
"compilerOptions": {
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "Bundler",
"strict": true,
"skipLibCheck": true,
"lib": [
"ESNext"
],
"jsx": "react-jsx",
"jsxImportSource": "hono/jsx"
},
}

38
api/wrangler.jsonc Normal file
View file

@ -0,0 +1,38 @@
{
"$schema": "node_modules/wrangler/config-schema.json",
"name": "themepark-assistant",
"main": "src/index.ts",
"compatibility_date": "2025-09-07"
// "compatibility_flags": [
// "nodejs_compat"
// ],
// "vars": {
// "MY_VAR": "my-variable"
// },
// "kv_namespaces": [
// {
// "binding": "MY_KV_NAMESPACE",
// "id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
// }
// ],
// "r2_buckets": [
// {
// "binding": "MY_BUCKET",
// "bucket_name": "my-bucket"
// }
// ],
// "d1_databases": [
// {
// "binding": "MY_DB",
// "database_name": "my-database",
// "database_id": ""
// }
// ],
// "ai": {
// "binding": "AI"
// },
// "observability": {
// "enabled": true,
// "head_sampling_rate": 1
// }
}