Deno.js POGO Server Framework to Server Static Files and Make Routes in Browser Using TypeScript Full Project For Beginners

 

 

Hello World Program

 

 

import pogo from 'https://deno.land/x/pogo/main.ts';

const server = pogo.server({ port : 3000 });

server.router.get('/', () => {
    return 'Hello, world!';
});

server.start();

 

 

 

Serving Static Files

 

 

import pogo from 'https://deno.land/x/pogo/main.ts';

const server = pogo.server({ port : 3000 });

server.router.get('/movies/{file*}', (request, h) => {
    return h.directory('movies');
});

server.start();

 

 

 

Leave a Reply