-
-
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.
backend: added nitro server for ts backend
- Loading branch information
1 parent
8f4800e
commit eb99cbc
Showing
12 changed files
with
91 additions
and
3 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,46 @@ | ||
/** @type {import("eslint").Linter.Config} */ | ||
const config = { | ||
parser: "@typescript-eslint/parser", | ||
parserOptions: { | ||
project: "./tsconfig.json", // Update the path to your tsconfig.json file | ||
}, | ||
plugins: ["@typescript-eslint"], | ||
extends: [ | ||
"plugin:@next/next/recommended", | ||
"plugin:@typescript-eslint/recommended-type-checked", | ||
"plugin:@typescript-eslint/stylistic-type-checked", | ||
require.resolve("@vercel/style-guide/eslint/node"), | ||
require.resolve("@vercel/style-guide/eslint/browser"), | ||
require.resolve("@vercel/style-guide/eslint/typescript"), | ||
require.resolve("@vercel/style-guide/eslint/react"), | ||
require.resolve("@vercel/style-guide/eslint/next"), | ||
], | ||
rules: { | ||
// These opinionated rules are enabled in stylistic-type-checked above. | ||
// Feel free to reconfigure them to your own preference. | ||
"@typescript-eslint/array-type": "off", | ||
"@typescript-eslint/consistent-type-definitions": "off", | ||
|
||
"@typescript-eslint/consistent-type-imports": [ | ||
"warn", | ||
{ | ||
prefer: "type-imports", | ||
fixStyle: "inline-type-imports", | ||
}, | ||
], | ||
"@typescript-eslint/no-unused-vars": ["warn", { argsIgnorePattern: "^_" }], | ||
"@typescript-eslint/require-await": "off", | ||
"@typescript-eslint/no-misused-promises": [ | ||
"error", | ||
{ | ||
checksVoidReturn: { attributes: false }, | ||
}, | ||
], | ||
"no-console": ["warn", { allow: ["warn", "error"] }], | ||
"no-return-await": "off", | ||
"import/no-default-export": "off", | ||
"import/no-extraneous-dependencies": "off", | ||
}, | ||
}; | ||
|
||
module.exports = config; |
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 | ||
dist | ||
.data | ||
.nitro | ||
.cache | ||
.output | ||
.env |
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,3 @@ | ||
# Nitro starter | ||
|
||
Look at the [nitro quick start](https://nitro.unjs.io/guide#quick-start) to learn more how to get started. |
Binary file not shown.
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,4 @@ | ||
//https://nitro.unjs.io/config | ||
export default defineNitroConfig({ | ||
srcDir: "server" | ||
}); |
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 @@ | ||
{ | ||
"name": "@quotes/nitro", | ||
"private": true, | ||
"scripts": { | ||
"build": "nitro build", | ||
"dev": "nitro dev --port 3001", | ||
"prepare": "nitro prepare", | ||
"preview": "node .output/server/index.mjs" | ||
}, | ||
"devDependencies": { | ||
"nitropack": "latest" | ||
} | ||
} |
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,6 @@ | ||
import { db, eq, quote } from "@quotes/db" | ||
|
||
export default eventHandler(async (event) => { | ||
const data = await db.query.quote.findFirst({ where: eq(quote.id, 1) }) | ||
return "Start by editing <code>server/routes/index.ts</code>."; | ||
}); |
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 @@ | ||
// https://nitro.unjs.io/guide/typescript | ||
{ | ||
"extends": "./.nitro/types/tsconfig.json", | ||
"compilerOptions": { | ||
"strictNullChecks": 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
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