sholladay / pogo

Server framework for Deno

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

First example doesnt work

Lumca opened this issue · comments

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.

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.

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

It seems its already fixed in master branch:
#54

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

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