1.1.0 • Published 7 years ago

oly-api v1.1.0

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

oly api

REST API with koa and decorators.

oly api is a module of the oly project.

import { inject, Kernel } from "oly";
import { ApiProvider, get } from "oly-api";

class Repo {
  query = () => Promise.resolve([1, 2, 3]);
}

class Api {
  @inject repo: Repo;

  @get("/users")
  async findUsers() {
    return await this.repo.query();
  }
}

Kernel
  .create({
    HTTP_SERVER_PORT: 6000,
  })
  .with(Api, ApiProvider)
  .start()
  .catch(console.error);

// curl http://localhost:6000/api/users -> [1,2,3]

Installation

$ npm install oly oly-api
1.1.0

7 years ago

1.0.0

7 years ago

0.15.2

7 years ago

0.15.1

7 years ago

0.15.0

7 years ago

0.14.4

7 years ago

0.14.3

7 years ago

0.14.2

7 years ago

0.14.1

7 years ago

0.14.0

7 years ago

0.13.0

7 years ago

0.12.15

7 years ago

0.12.14

7 years ago

0.12.13

7 years ago

0.12.12

7 years ago

0.12.11

7 years ago

0.12.10

7 years ago

0.12.9

7 years ago

0.12.8

7 years ago

0.12.7

7 years ago

0.12.6

7 years ago

0.12.5

7 years ago

0.12.4

7 years ago

0.12.3

7 years ago

0.12.2

7 years ago

0.12.1

7 years ago

0.11.4

7 years ago

0.11.3

7 years ago

0.11.2

7 years ago

0.11.1

7 years ago

0.11.0

7 years ago

0.10.4

7 years ago

0.10.3

7 years ago

0.10.2

7 years ago

0.10.1

7 years ago

0.10.0

7 years ago

0.9.3

7 years ago

0.9.2

7 years ago

0.9.1

8 years ago

0.9.0

8 years ago

0.8.12

8 years ago

0.8.11

8 years ago

0.8.10

8 years ago

0.8.9

8 years ago

0.8.8

8 years ago

0.8.7

8 years ago

0.8.6

8 years ago

0.8.5

8 years ago

0.8.4

8 years ago

0.8.3

8 years ago

0.8.2

8 years ago

0.8.1

8 years ago

0.8.0

8 years ago

0.7.7

8 years ago

0.7.6

8 years ago

0.7.5

8 years ago

0.7.4

8 years ago

0.7.3

8 years ago

0.7.0

8 years ago

0.6.5

8 years ago

0.6.4

8 years ago

0.6.2

8 years ago

0.6.1

8 years ago

0.6.0

8 years ago

0.5.2

8 years ago

0.5.1

8 years ago

0.5.0

8 years ago

0.4.6

8 years ago

0.4.5

8 years ago

0.4.4

8 years ago

0.4.3

8 years ago

0.4.2

8 years ago

0.4.1

8 years ago

0.4.0

8 years ago