This file contains hidden or 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": "express-react-typescript", | |
"version": "1.0.0", | |
"description": "Typescript stack", | |
"main": "dist/bundle-be.js", | |
"author": "Saif ur Rehman", | |
"license": "MIT", | |
"scripts": { | |
"bundle": "webpack --hot", | |
"start": "node dist/bundle-be.js", |
This file contains hidden or 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 { Router } from "express"; | |
import "reflect-metadata"; | |
class IndexController { | |
public router: Router; | |
constructor() { | |
this.router = Router(); | |
this.routes(); | |
} | |
private routes() { | |
this.router.get("/healthz", (_, res) => { |
This file contains hidden or 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
FROM appsody/nodejs:0.3 | |
RUN npm i -g webpack webpack-cli jest | |
ENV APPSODY_PROJECT_DIR=/project | |
ENV APPSODY_MOUNTS=/:/project/user-app | |
ENV APPSODY_DEPS=/project/user-app/node_modules | |
ENV APPSODY_WATCH_DIR=/project/user-app | |
ENV APPSODY_WATCH_IGNORE_DIR=/project/user-app/node_modules | |
ENV APPSODY_WATCH_REGEX="^.*.ts$" |
This file contains hidden or 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 bodyParser from "body-parser"; | |
import IndexController from "../user-app/src/index"; | |
const health = require('@cloudnative/health-connect'); | |
class App { | |
public express: express.Application; | |
constructor() { | |
this.express = express(); | |
this.middleware(); | |
this.routes(); |
This file contains hidden or 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 http from "http"; | |
import debug from "debug"; | |
import App from "./server"; | |
debug("ts-express:server"); | |
class InitServer { | |
private port: number | boolean | string; | |
private server: any; |
This file contains hidden or 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
FROM node:12 | |
# Install OS updates | |
RUN apt-get update \ | |
&& apt-get dist-upgrade -y \ | |
&& apt-get clean \ | |
&& echo 'Finished installing dependencies' | |
# Install stack dependencies | |
WORKDIR /project/user-app | |
COPY ./package*.json ./ | |
RUN npm install --production |
This file contains hidden or 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
{ | |
"typeAcquisition": { | |
"include": [ | |
"jest" | |
] | |
} | |
} |
This file contains hidden or 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 = { | |
roots: ['<rootDir>/src'], | |
transform: { | |
'^.+\\.tsx?$': 'ts-jest', | |
}, | |
testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.tsx?$', | |
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'], | |
testEnvironment: 'node', | |
"preset": "@shelf/jest-mongodb" | |
} |
This file contains hidden or 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": "express-react-typescript", | |
"version": "1.0.0", | |
"description": "Accounts microservice", | |
"main": "dist/bundle-be.js", | |
"author": "Saif ur Rehman", | |
"license": "MIT", | |
"scripts": { | |
"bundle": "webpack --hot", | |
"start": "node dist/bundle-be.js", |
This file contains hidden or 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
{ | |
"compilerOptions": { | |
"types": ["reflect-metadata", "jest"], | |
"moduleResolution": "node", | |
"experimentalDecorators": true, | |
"emitDecoratorMetadata": true, | |
"inlineSourceMap": true, | |
/* Basic Options */ | |
// "strict": true /* Enable all strict type-checking options. */, | |
// "noImplicitAny": true /* Raise error on expressions and declarations with an implied 'any' type. */, |
NewerOlder