Skip to content

Commit

Permalink
use instance method instead of static method for controllers; remove …
Browse files Browse the repository at this point in the history
…demos; add `method` decorator for restful api
  • Loading branch information
vilicvane committed Dec 19, 2015
1 parent d6b4c0f commit a28a5d3
Show file tree
Hide file tree
Showing 84 changed files with 121 additions and 26,128 deletions.
1 change: 0 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/.vscode/
/bld/test/
/demo/
/src/
/test/
/typings/
Expand Down
21 changes: 3 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ You may configure tasks using [gulp](http://gulpjs.com/) or other tools.
VIO is developed in [TypeScript](http://www.typescriptlang.org/).
As it's using new ECMAScript features, you will need to use compiler or transpiler like TypeScript or [Babel](https://babeljs.io/).

For minimum demo in TypeScript, please check out [vio-minimum-demo](https://github.com/vilic/vio-minimum-demo).

## Features

- Map routes and controllers based on file paths.
Expand Down Expand Up @@ -123,10 +121,10 @@ app.listen(1337);
import { Controller, get } from 'vio';

// extends `Controller` class.
export default class DefaultController extends Controller {
export default class extends Controller {
// route as a HTTP GET request.
@get()
static default() {
default() {
// can also be a promise if it's async.
return {
title: 'Hello, VIO!',
Expand Down Expand Up @@ -154,20 +152,7 @@ export default class DefaultController extends Controller {

Now compile files in `src` into `bld` and run `node bld/server.js` to start the server.

Please checkout the demo folder for more usage. To try a demo:

```sh
# cd to a demo folder.
cd demo/single

# install dependencies.
npm install

# start node.
node bld/index.js

# visit http://localhost:1337/.
```
Please checkout [demos](https://github.com/vilic/vio-demos) for more usage.

## Dynamic Loading

Expand Down
10 changes: 0 additions & 10 deletions demo/api/bld/index.js

This file was deleted.

1 change: 0 additions & 1 deletion demo/api/bld/index.js.map

This file was deleted.

36 changes: 0 additions & 36 deletions demo/api/bld/routes/hello.js

This file was deleted.

1 change: 0 additions & 1 deletion demo/api/bld/routes/hello.js.map

This file was deleted.

11 changes: 0 additions & 11 deletions demo/api/package.json

This file was deleted.

14 changes: 0 additions & 14 deletions demo/api/src/index.ts

This file was deleted.

18 changes: 0 additions & 18 deletions demo/api/src/routes/hello.ts

This file was deleted.

15 changes: 0 additions & 15 deletions demo/api/tsconfig.json

This file was deleted.

Loading

0 comments on commit a28a5d3

Please sign in to comment.