mirror of
https://github.com/roleypoly/roleypoly-v1.git
synced 2025-06-16 18:29:08 +00:00
add tests; resync files, forgot where i was.
This commit is contained in:
parent
6b36b1d5f2
commit
1a794e2d7e
30 changed files with 3654 additions and 534 deletions
|
@ -1,14 +1,23 @@
|
|||
// @flow
|
||||
import { type AppContext } from '../Roleypoly'
|
||||
import { type Context } from 'koa'
|
||||
import * as secureAs from './_security'
|
||||
export default ($: AppContext) => ({
|
||||
// i want RPC to be *dead* simple.
|
||||
// probably too simple.
|
||||
hello (_: Context, hello: string) {
|
||||
return `hello, ${hello}!`
|
||||
return `hello, ${hello} and all who inhabit it`
|
||||
},
|
||||
|
||||
testJSON (_: Context, inobj: {}) {
|
||||
return inobj
|
||||
}
|
||||
},
|
||||
|
||||
testDecide: secureAs.decide($,
|
||||
[ secureAs.root, () => { return 'root' } ],
|
||||
[ secureAs.manager, () => { return 'manager' } ],
|
||||
[ secureAs.member, () => { return 'member' } ],
|
||||
[ secureAs.authed, () => { return 'authed' } ],
|
||||
[ secureAs.any, () => { return 'guest' } ]
|
||||
)
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue