import express from 'express' ; require ( 'express-async-errors' ) ; import compression from 'compression' ; import path from 'path' ; import { publicDirectory } from '../common' ; import { catchAllRouter , robotsTxtRouter } from './routers' ; const app = express ( ) ; app . use ( compression ( ) ) ; app . use ( express . static ( path . join ( publicDirectory , '.' ) ) ) ; app . use ( robotsTxtRouter ) ; app . use ( catchAllRouter ) ; const port = parseInt ( process . env . PORT , 10 ) || 80 ; app . listen ( port , ( ) => console . log ( `Ethereum Studio is listening on port ${ port }\nPublic directory path set to ${ publicDirectory }` ) ) ; export default app ;