A REST API over Express and Typescript
Last updated 2 months ago by dresendez .
Apache-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @zerooneit/expressive-tea 
SYNC missed versions from official npm registry.

Expressive Tea

npm (scoped) Known Vulnerabilities Build Status codecov Maintainability npm GitHub issues GitHub FOSSA Status

Expressive Tea

A Typescript library to create RESTful Services.


Expressive Tea is a simple library which allow to generate RESTful services with Typescript over Expressjs.

Edit expressive-tea


  • Server Initialization and Configurations with ability to setup server through server stages.
  • Declare Server Middlewares configuration as hard or soft dependency at server level.
  • Declarative Modules to allow create modular RESTful Servers.
  • Dependency Injection on controllers as providers with InversifyJs.
  • Declarative Router on Controllers.
  • Declarative Verbs and Middlewares under module and verb level.
  • Declarative Exceptions for a better Error Handling.
  • Can declare models depending on your flavor, we recommend Mongoose or Sequelize flavors.


The main idea is help developers to generate a RESTful service quick and modulable through descriptive decorators and settings on top of ExpressJS. Expressive Tea is a clean, simple and descriptive mini framework which allow create REST services quickly saving time with the creation of routers and other express components with a clean, descriptive decorator.


npm i --save @zerooneit/expressive-tea

Important! Expressive Tea requires Node >= 6, Express >= 4, TypeScript >= 2.0 and the experimentalDecorators, lib compilation options in your tsconfig.json with the next configuration.

  "compilerOptions": {
    "baseUrl": ".",
    "sourceMap": true,
    "noEmit": false,
    "noImplicitAny": false,
    "target": "es6",
    "lib": [
    "types": [
    "module": "commonjs",
    "moduleResolution": "node",
    "experimentalDecorators": true,
    "emitDecoratorMetadata": true,
    "declaration": true
  "include": [


You can looking into our simple example here.

Quick Start

Boot Stages

The Application internally is ordering the plugs on the next order:

BOOT_DEPENDENCIES: This is executing when express server applications is created.

INITIALIZE_MIDDLEWARES: Global middleware initialization.

APPLICATION: This should contain express configuration or application configurations.

MODULES: This is an internal stage that is used only to create the modules.

AFTER_APPLICATION_MIDDLEWARES: Middlewares commonly used after setup the modules, commonly for error handler.

START: Can be used to add additional configuration as websocket implementation or another service.

Declare a Server

import Boot from '@zerooneit/expressive-tea/classes/Boot';
import { BOOT_STAGES } from '@zerooneit/expressive-tea/libs/constants';
import { Plug, ServerSettings, RegisterModule } from '@zerooneit/expressive-tea/decorators/server';
import RootModule from './app/Root/RootModule';
import logSetting from './config/TestPlug';

	port: 3001

@Plug(BOOT_STAGES.BOOT_DEPENDENCIES, 'Log Middleware', logSetting)
class BootLoader extends Boot {
	async start() {

export default new BootLoader().start()
  .catch(error => console.log(error.message));

Generate A Plug Setting

The plugin always needs to be a method which is receiving express server application.

export default function testPlug(server) {
    server.use(function(req, res, next) {
        console.log('This should be executed everytime in all the endpoints');

Generate Modules

import { Module } from '@zerooneit/expressive-tea/decorators/module';
import RootController from './controllers/RootController';
import TestService from './services/TestService';

	controllers: [RootController], // Controllers Defined
	providers: [TestService], // Dependency Injection Providers
	mountpoint: '/' // Mountpoint Route starting from root.
export default class TestModule {}

Generate Controllers

import { Get, Route } from '@zerooneit/expressive-tea/decorators/router';
import { Inject } from '@zerooneit/expressive-tea/services/DependencyInjection';

export default class RootController {
  * Injected Provider Instance into controller property 
	// Set and enpoint over module root endpoint
	async index(req, res) {
		res.send('is Working!!');

	async test(req, res) {
		res.json({success: true, message: 'this is working too'});

	async testInject(req, res) {

Generate Injectable Service

import {injectable} from 'inversify';

export default class TestService {
    test() {
        return 'This is a injectable service';


If you are experience any kind of issues we will be happy to help. You can report an issue using the issues page or the chat. You can also ask questions at Stack overflow using the expressive-tea tag.

If you want to share your thoughts with the development team or join us you will be able to do so using the official the mailing list. You can check out the wiki to learn more about Expressive Tea internals or check our documentation.

Built With


Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.


We use SemVer for versioning. For the versions available, see the tags on this repository.


See also the list of contributors who participated in this project.


This project is licensed under the Apache-2.0 License - see the LICENSE file for details

FOSSA Status


The banner and the logo is a derivate work Designed by Freepik

Current Tags

  • 1.1.4                                ...           latest (2 months ago)

15 Versions

  • 1.1.4                                ...           2 months ago
  • 1.1.3                                ...           3 months ago
  • 1.1.2                                ...           3 months ago
  • 1.1.1                                ...           3 months ago
  • 1.1.0                                ...           8 months ago
  • 1.0.0                                ...           9 months ago
  • 0.1.1                                ...           10 months ago
  • 0.1.0                                ...           10 months ago
  • 0.0.7-RC                                ...           10 months ago
  • 0.0.6-RC1                                ...           a year ago
  • 0.0.5-Beta                                ...           a year ago
  • 0.0.4-Beta                                ...           a year ago
  • 0.0.3-Alpha                                ...           a year ago
  • 0.0.2-Alpha                                ...           a year ago
  • 0.0.1                                ...           a year ago
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (6)
Dev Dependencies (20)
Dependents (0)

Copyright 2014 - 2016 © taobao.org |