'use strict' ; import * as express from 'express' ; import { promisify } from 'util' ; const readFile = promisify ( require ( 'fs' ) . readFile ) ; import { findConfigFileSync } from '../lib/utils' ; const router = express . Router ( ) ; router . get ( '/' , async function ( req , res , next ) { const title = 'NodeTyped Express' ; try { let fileName = findConfigFileSync ( 'package.json' ) ; let data = await readFile ( fileName , 'utf-8' ) ; res . render ( 'index' , { title , file : data } ) ; } catch ( err ) { next ( err ) ; } } ) ; export = router ;