Nexys typescript web framework (built on top of Koa and Nexys System SDK)
see /server
for example implementation or https://github.com/nexys-system/server-boilerplate
path suggestion: src/service/cache.ts
import { Cache } from '@nexys/core';
export default new Cache.Local({persistent: true });
path suggestion: src/middleware/auth.ts
import { Middleware} from '@nexys/core';
import * as Login from '../service/login';
import cache from '../service/cache';
// initalizes the middleware auth with
// - `Profile` defines the JWT Profile shape
// - `UserCache` defines the shape of the information saved in the userCache
// - `cache`reference to the cache
export default new Middleware.Auth<Login.Profile, Login.UserCache>(cache);