import { Request , Response } from 'express' ; import express from 'express' ; const router = express . Router ( ) ; import skillsWidget from '../../src/widgets/skills' ; import { getBoolean } from '../../src/utils' ; import errorWidget from '../../src/widgets/error' ; router . get ( '/' , function ( req , res ) { const { names , includeNames } = req . query ; res . setHeader ( 'Content-Type' , 'image/svg+xml' ) ; if ( names === undefined || names === null ) { res . send ( errorWidget ( 'Skills' , '-24%' , 'Languages are undefined!' , '-28%' ) ) ; return ; } res . send ( skillsWidget ( String ( names ) , getBoolean ( String ( includeNames ) ) ) ) ; } ) ; export default router ;