sholladay / pogo

Server framework for Deno
Mozilla Public License 2.0
482 stars 32 forks source link

First example doesnt work #56

Closed Lumca closed 3 years ago

Lumca commented 3 years ago

Hello,

I am building my first api and I have randomly chosen pogo.

But first example doesnt work:

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

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

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

server.start();
C:\Users\lumir\Documents\GitHub\DENO_API>deno run --allow-net server.js
Check file:///C:/Users/lumir/Documents/GitHub/DENO_API/server.js
error: TS1205 [ERROR]: Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'.
    NamedStat
    ~~~~~~~~~
    at https://deno.land/x/pogo@v0.5.1/lib/util/read-dir-stats.ts:24:5

TS1205 [ERROR]: Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'.
export { FileHandlerOptions } from './helpers/file.ts';
         ~~~~~~~~~~~~~~~~~~
    at https://deno.land/x/pogo@v0.5.1/lib/types.ts:41:10

TS1205 [ERROR]: Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'.
export { DirectoryHandlerOptions } from './helpers/directory.tsx';
         ~~~~~~~~~~~~~~~~~~~~~~~
    at https://deno.land/x/pogo@v0.5.1/lib/types.ts:42:10

Found 3 errors.
sholladay commented 3 years ago

This is probably an issue related to your Deno version. Pogo was most recently tested with Deno 1.2. I'd love to get us up to speed with the latest Deno version!

Would you like to submit a PR to help fix it? Should be a very small change. Looks like we just need to change export to export type.

patlehmann1 commented 3 years ago

I'd like to work on this if @Lumca doesn't want to take it.

Lumca commented 3 years ago

It seems its already fixed in master branch: https://github.com/sholladay/pogo/pull/54

I have imported master branch locally and it is working. So updating the version on Deno would fix this.

sholladay commented 3 years ago

Okay, great. I'll update the tested Deno version and make a new release soon.