A better way to experience koa2 !
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
examples
lib
release
.babelrc
.gitignore
README.md
index.d.ts
package-lock.json
package.json

README.md

A better way to experience koa2 !

let`s go to see the HelloWorld !

first, you have to add a .babelrc file:

{
    "presets": [
        ['env', {
          "targets": {
            "node": "current"
          }
        }]
    ],
    "plugins": ["transform-decorators-legacy", "transform-class-properties"]
}

then, add a entry file, like start.js:

require('babel-core/register');
require('./hello_world');

hello_world.js

import { startApp, Router } from 'eryue';

@Router.get({
	'/': 'Hello, world !'
})
class App {
	port = 1234
}

startApp(App).then(port => console.log(`a app started at port: ${port} !`));

last, startup !

npm i -D babel-core babel-plugin-transform-class-properties babel-plugin-transform-decorators-legacy babel-preset-env
node start