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
Show hidden characters
{ | |
"compilerOptions": { | |
"target": "es2016", | |
"module": "commonjs", | |
"outDir": "./dist", | |
"rootDir": "./src", | |
"sourceMap": true, | |
"strict": 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
{ | |
"name": "ts-debugging", | |
"version": "1.0.0", | |
"description": "A tutorial repository, created to have a debug example for the medium article", | |
"main": "index.js", | |
"scripts": { | |
"start:dev" : "nodemon ./src/index.ts", | |
"start:debug" : "nodemon --inspect src/entry.ts" | |
"build": "tsc" | |
}, |
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
{ | |
"restartable": "rs", | |
"ignore": [".git", "node_modules/**/node_modules"], | |
"verbose": true, | |
"execMap": { | |
"ts": "node --require ts-node/register" | |
}, | |
"watch": ["src/"], | |
"env": { | |
"NODE_ENV": "development" |
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
import express, { Request, Response } from 'express'; | |
const app = express(); | |
app.get('/_healthcheck', (req: Request, res: Response) => { | |
res.json({ uptime: process.uptime() }); | |
}); | |
app.get('/areWeDebugging?', (req: Request, res: Response) => { | |
res.json({ hellYeah: 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
{ | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"type": "node", | |
"request": "attach", | |
"port": 9229, | |
"name": "Attach to port", | |
"sourceMaps": true, | |
"skipFiles": ["<node_internals>/**"], |
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
export default { | |
clearMocks: true, | |
collectCoverage: true, | |
coverageDirectory: 'coverage', | |
coveragePathIgnorePatterns: [ | |
'/node_modules/', | |
'/src/db/', |
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
module.exports = { | |
env: { | |
commonjs: true, | |
es2021: true, | |
node: true, | |
'jest/globals': true, | |
}, | |
extends: ['airbnb-base'], | |
parser: '@typescript-eslint/parser', | |
parserOptions: { |
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
import compression from 'compression'; | |
import cors from 'cors'; | |
import express, { Express } from 'express'; | |
import 'reflect-metadata'; | |
import { createRouter as routes } from '../api/rest/v1/routes/routes'; | |
import logger from '../config/logger'; | |
import morganMiddleware from '../config/morgan'; | |
export class Server { | |
private static app: Express; |
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
import { Express } from 'express'; | |
import config from './config/config'; | |
import AppDataSource from './config/data-source'; | |
import logger from './config/logger'; | |
import { errorHandler } from './util/customError'; | |
import { Server } from './util/Server'; | |
const app = Server.getServer(); | |
// eslint-disable-next-line no-shadow |
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
import { Request, Response } from 'express'; | |
// eslint-disable-next-line import/no-extraneous-dependencies | |
import request from 'supertest'; | |
import { Server } from '../../../../../../util/Server'; | |
import { DummyController } from '../Auth.controller'; | |
describe('DummyController', () => { | |
const dummyController = new AuthController(); | |
describe('getTest', () => { |
OlderNewer