require ( 'dotenv' ) . config ( ) ; import { Request , Response } from 'express' ; import errorWidget from '../src/widgets/error' ; import routes from './routes' ; import express from 'express' ; const app = express ( ) ; app . use ( '/api' , routes ) ; app . use ( '*' , ( req , res ) => { res . setHeader ( "Content-Type" , "image/svg+xml" ) ; res . send ( errorWidget ( 'Unknown' , '-28%' , 'Invalid API URL!' , '-19%' ) ) ; } ) ; app . listen ( process . env . PORT , ( ) => { console . log ( `Github-WidgetBox listening at http://localhost:${ process . env . PORT }` ) ; } ) ;