Skip to content

Instantly share code, notes, and snippets.

View dgreene1's full-sized avatar

Dan Greene dgreene1

View GitHub Profile
@dgreene1
dgreene1 / server.2018.ts
Last active June 10, 2020 13:08
on-premise out-of-date problem / forward compatible problem (what happens if a user hits the ui.2022.tsx page but it calls the server.2018.ts backend?)
export const getEndpoint = () => {
res.send({
id: 1,
name: "Bob Smith",
age: 33,
})
}
@dgreene1
dgreene1 / failIfMigrationIsNeeded.ts
Created July 25, 2019 14:26
How to check that you generated a schema when a TypeOrm entities change
import { execSync } from 'child_process';
import * as fs from 'fs';
// tslint:disable-next-line: no-console
console.log('...');
// tslint:disable-next-line: no-console
console.log('Starting the process of checking if a migration script exists for the current schema...');
const failureArtifactName = 'FAILURE--THIS_PROVES_A_DEV_FORGOT_TO_GENERATE_AND_APPLY_A_SCHEMA';