-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Your Name
committed
Sep 18, 2023
0 parents
commit 83c3379
Showing
22 changed files
with
3,559 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
root = true | ||
|
||
[*] | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
charset = utf-8 | ||
|
||
[*.js] | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
[{package.json,*.yml,*.cjson}] | ||
indent_style = space | ||
indent_size = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
dist | ||
.output | ||
node-modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"extends": [ | ||
"@nuxtjs/eslint-config-typescript" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
node_modules | ||
*.log* | ||
.nitro | ||
.cache | ||
.output | ||
.env | ||
dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
shamefully-hoist=true | ||
strict-peer-dependencies=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Nitro Minimal Starter | ||
|
||
Look at the [Nitro documentation](https://nitro.unjs.io/) to learn more. | ||
|
||
## Setup | ||
|
||
Make sure to install the dependencies: | ||
|
||
```bash | ||
# npm | ||
npm install | ||
|
||
# yarn | ||
yarn install | ||
|
||
# pnpm | ||
pnpm install | ||
``` | ||
|
||
## Development Server | ||
|
||
Start the development server on <http://localhost:3000> | ||
|
||
```bash | ||
npm run dev | ||
``` | ||
|
||
## Production | ||
|
||
Build the application for production: | ||
|
||
```bash | ||
npm run build | ||
``` | ||
|
||
Locally preview production build: | ||
|
||
```bash | ||
npm run preview | ||
``` | ||
|
||
Check out the [deployment documentation](https://nitro.unjs.io/deploy) for more information. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/** | ||
* @file | ||
*/ | ||
|
||
import { defineEventHandler, fromNodeMiddleware } from 'h3' | ||
import { useDatasource } from '~/server/composables/use-datasource.composable' | ||
|
||
export default defineEventHandler(async (event) => { | ||
let { em, orm } = await useDatasource({ fork: true }) | ||
event.context.orm = orm | ||
event.context.em = em | ||
console.log('[db] id: ', event.context.em.id) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/** | ||
* @file | ||
*/ | ||
|
||
import morgan from 'morgan' | ||
import { fromNodeMiddleware } from 'h3' | ||
|
||
console.log('[morgan]') | ||
|
||
export default fromNodeMiddleware(morgan('tiny')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/** | ||
* @file | ||
*/ | ||
|
||
import cookieParser from 'cookie-parser' | ||
import { fromNodeMiddleware } from 'h3' | ||
|
||
console.log('[cookie parser]') | ||
|
||
export default fromNodeMiddleware(cookieParser()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/** | ||
* @file | ||
*/ | ||
|
||
import { defineEventHandler, fromNodeMiddleware} from 'h3' | ||
|
||
export default defineEventHandler(async (event) => { | ||
console.log('[route]', event.req.url) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
//https://nitro.unjs.io/config | ||
export default defineNitroConfig({ | ||
esbuild: { | ||
options: { | ||
tsconfigRaw: { | ||
compilerOptions: { | ||
experimentalDecorators: true, | ||
} | ||
} | ||
} | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
"private": true, | ||
"scripts": { | ||
"prepare": "nitropack prepare", | ||
"dev": "nitropack dev", | ||
"build": "nitropack build", | ||
"preview": "node .output/server/index.mjs" | ||
}, | ||
"dependencies": { | ||
"@mikro-orm/core": "^5.8.0", | ||
"@mikro-orm/mariadb": "^5.8.0", | ||
"@mikro-orm/migrations": "^5.8.0", | ||
"bcrypt": "^5.1.0", | ||
"cookie-parser": "^1.4.6", | ||
"morgan": "^1.10.0", | ||
"mysql2": "^3.6.0", | ||
"nitropack": "latest", | ||
"reflect-metadata": "^0.1.13", | ||
"ts-node": "^10.9.1" | ||
}, | ||
"devDependencies": { | ||
"@mikro-orm/cli": "^5.8.0" | ||
}, | ||
"mikro-orm": { | ||
"useTsNode": true, | ||
"tsConfigPath": "./tsconfig.mikro-orm.cli.json", | ||
"configPaths": [ | ||
"./server/data-source.js", | ||
"./server/data-source.ts" | ||
] | ||
} | ||
} |
Oops, something went wrong.