# @aotools/valka

> ``` ├── server.js ├── controllers | └── User.js ├── templates | └── index.html ```

Latest version **1.1.27** (published 2020-07-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install @aotools/valka
pnpm add @aotools/valka
yarn add @aotools/valka
bun add @aotools/valka
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.27 |
| Published | 2020-07-11 |
| First published | 2018-07-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 18 |
| Unpacked size | 25 KB |
| Known vulnerabilities | 0 (+3 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 3 |
| Author | lxzjj |
| Maintainers | livoras, lxzjj |
| Keywords | valka |

## Links

- npm: https://www.npmjs.com/package/@aotools/valka
- Repository: https://github.com/AoDraw/valka
- Homepage: https://github.com/AoDraw/valka#readme
- Issues: https://github.com/AoDraw/valka/issues
- npm.io page: https://npm.io/package/@aotools/valka

## Dependencies (18)

- [koa](https://npm.io/package/koa.md) ^2.4.1
- [fs-walk](https://npm.io/package/fs-walk.md) 0.0.1
- [koa-jwt](https://npm.io/package/koa-jwt.md) ^3.3.0
- [walk-sync](https://npm.io/package/walk-sync.md) ^2.2.0
- [@types/koa](https://npm.io/package/@types/koa.md) ^2.0.46
- [koa-router](https://npm.io/package/koa-router.md) ^7.3.0
- [koa-static](https://npm.io/package/koa-static.md) ^4.0.2
- [@types/node](https://npm.io/package/@types/node.md) ^10.5.2
- [art-template](https://npm.io/package/art-template.md) ^4.12.2
- [jsonwebtoken](https://npm.io/package/jsonwebtoken.md) ^8.1.0
- [@types/koa-jwt](https://npm.io/package/@types/koa-jwt.md) ^3.3.0
- [koa-bodyparser](https://npm.io/package/koa-bodyparser.md) ^4.2.0
- [koa-static-cache](https://npm.io/package/koa-static-cache.md) ^5.1.1
- [@types/koa-router](https://npm.io/package/@types/koa-router.md) ^7.0.30
- [@types/koa-static](https://npm.io/package/@types/koa-static.md) ^4.0.0
- [@types/jsonwebtoken](https://npm.io/package/@types/jsonwebtoken.md) ^7.2.8
- [@types/koa-bodyparser](https://npm.io/package/@types/koa-bodyparser.md) ^5.0.1
- [@types/koa-static-cache](https://npm.io/package/@types/koa-static-cache.md) ^5.1.0

## Recent versions

- 1.1.27 (latest) — 2020-07-11
- 1.1.26 — 2020-07-11
- 1.1.24 — 2020-07-05
- 1.1.22 — 2018-11-16
- 1.1.21 — 2018-08-01
- 1.1.20 — 2018-07-23
- 1.1.19 — 2018-07-23
- 1.1.18 — 2018-07-23
- 1.1.17 — 2018-07-23
- 1.1.16 — 2018-07-23
- 1.1.15 — 2018-07-23
- 1.1.14 — 2018-07-23
- 1.1.13 — 2018-07-23
- 1.1.12 — 2018-07-23
- 1.1.10 — 2018-07-23
- … 10 more at https://npm.io/package/@aotools/valka/versions

## README

### 工程目录结构
```
├── server.js  
├── controllers  
|   └── User.js  
├── templates  
|   └── index.html
```

### Valka
```javascript
import {Valka} from 'valka'

Valka({
  baseDir: __dirname,
  port: 3000,
  enableAuth: true,
  jwtSecret: "xxx",
})
```

### Controller
```javascript
import {Controller, Get, IContext, RequireLogin} from 'valka'

@Controller('/api/users')
export class User {
  @Get('/', 'index.html')
  async render() {
    return { title: "title" }
  }

  @Get('/')
  @RequireLogin()
  async getUsers (ctx: IContext) {
    const ctx.state.user
    return { users: [user] }
  }
}
```

### 使用
``` shell
npm i valka --save
```

---
_Source: https://npm.io/package/@aotools/valka · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
