Skip to content

Instantly share code, notes, and snippets.

View SaifRehman's full-sized avatar
🎯
Focusing

SaifRehman SaifRehman

🎯
Focusing
  • IBM
  • Dubai
View GitHub Profile
{
"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",
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) => {
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$"
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();
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;
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
{
"typeAcquisition": {
"include": [
"jest"
]
}
}
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"
}
{
"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",
{
"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. */,