Skip to content

evanx/redis-koa-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

70 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

redis-koa-app

Redis Koa2 application archetype.

This provides lifecycle boilerplate reused across similar applications.

Usage

The app's index.js entry-point uses the redis-koa-app-rpf application archetype.

require('redis-koa-app')(
    require('../package'),
    require('./spec'),
    async deps => Object.assign(global, deps),    
    () => require('./main')
).catch(err => {
    console.error(err);
});

where we extract the config from process.env according to the spec and invoke our main function.

In the above example, we assign the archetype's dependencies on global before main.js is parsed i.e. including:

    const redisApp = {
        assert, clc, lodash, Promise,
        asserta, asserto,
        DataError, StatusError,
        redis, client, logger, config,
        multiExecAsync
    };

Implementation

See index.js https://github.com/evanx/redis-koa-app/blob/master/index.js

Uses

Used by:

Inter alia:


https://twitter.com/@evanxsummers

About

Redis Koa2 application archetype.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published