-
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
Showing
12 changed files
with
60 additions
and
44 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 |
---|---|---|
@@ -1,15 +1,13 @@ | ||
{ | ||
"env": { | ||
"es2021": true, | ||
"node": true | ||
}, | ||
"extends": "standard-with-typescript", | ||
"overrides": [ | ||
], | ||
"parserOptions": { | ||
"ecmaVersion": "latest", | ||
"sourceType": "module" | ||
}, | ||
"rules": { | ||
} | ||
"env": { | ||
"es2021": true, | ||
"node": true | ||
}, | ||
"extends": ["standard-with-typescript", "prettier"], | ||
"overrides": [], | ||
"parserOptions": { | ||
"ecmaVersion": "latest", | ||
"sourceType": "module" | ||
}, | ||
"rules": {} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
dist | ||
coverage | ||
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 @@ | ||
{} |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
import express, { type Express, type Request, type Response } from 'express' | ||
import express, { type Express, type Request, type Response } from "express"; | ||
|
||
const app: Express = express() | ||
const app: Express = express(); | ||
|
||
app.get('/', (req: Request, res: Response) => { | ||
res.send('Express + TypeScript Server') | ||
}) | ||
app.get("/", (req: Request, res: Response) => { | ||
res.send("Express + TypeScript Server"); | ||
}); | ||
|
||
export default app | ||
export default app; |
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 |
---|---|---|
@@ -1,16 +1,17 @@ | ||
import Joi from 'joi' | ||
import Joi from "joi"; | ||
|
||
const schema = Joi | ||
.object() | ||
const schema = Joi.object() | ||
.keys({ | ||
PORT: Joi.number().required().default(3000), | ||
}) | ||
.unknown() | ||
.unknown(); | ||
|
||
const { value: env, error } = schema.prefs({ errors: { label: 'key' } }).validate(process.env) | ||
const { value: env, error } = schema | ||
.prefs({ errors: { label: "key" } }) | ||
.validate(process.env); | ||
|
||
if (error != null) { | ||
throw new Error(`Config validation error: ${error.message}`) | ||
throw new Error(`Config validation error: ${error.message}`); | ||
} | ||
|
||
export default env | ||
export default 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 |
---|---|---|
@@ -1,5 +1,3 @@ | ||
import env from './env' | ||
import env from "./env"; | ||
|
||
export { | ||
env | ||
} | ||
export { 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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import app from './app' | ||
import { env } from './config' | ||
import app from "./app"; | ||
import { env } from "./config"; | ||
|
||
app.listen(env.PORT, () => { | ||
console.log(`⚡️[server]: Server is running at http://localhost:${env.PORT}`) | ||
}) | ||
console.log(`⚡️[server]: Server is running at http://localhost:${env.PORT}`); | ||
}); |
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