GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — studio/index.es.js at master · devpunks/studio Expand file tree/ Copy pathindex.es.jsMore file actions 34 lines (27 loc) · 1.02 KB / Copy pathindex.es.jsFile metadata and controls34 lines (27 loc) · 1.02 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 // Express documentation - https://expressjs.com/en/api.html // Express.js Alternatives - https://betterstack.com/community/guides/scaling-nodejs/expressjs-alternatives import http from 'http' import { json // parser , Router // router , default as express // server } from 'express' import log from './logger.js' const { METHODS } = http , { PORT = 3000 } = process.env console.log ( METHODS ) export default class Resource extends Router { constructor() { super ( { strict: true, caseSensitivity: true, mergeParams: true } ) // .route ( '/' ) .get ( '/', ( req, res ) => res.json ( { data: 'SHEESH' } ) ) .get ( '/welcome', ( req, res ) => res.send ( '<h1>Hello</h1> welcome to my http server made with express' ) ) } // custructor } // Resource const app = ( new Resource ) .use ( log ( 'foo.log' ) ) .use ( ( req, res, next ) => res.status ( 404 ).send ( "That route doesn't exist" ) ) void ( new express () ) .use( app ) .listen ( PORT, _ => console.log ( `Listening on port ${PORT}` ) ) |
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |