# miter

> A typescript web framework based on ExpressJs based loosely on SailsJs

Latest version **0.6.3** (published 2018-03-03) · SEE LICENSE IN LICENSE.md license · 0 weekly downloads

## Install

```sh
npm install miter
pnpm add miter
yarn add miter
bun add miter
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.6.3 |
| Published | 2018-03-03 |
| First published | 2016-10-28 |
| Weekly downloads | 0 |
| License | SEE LICENSE IN LICENSE.md |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 25 |
| Unpacked size | 593.8 KB |
| Known vulnerabilities | 0 (+2 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 4 |
| Maintainers | aboveyou00 |
| Keywords | miter, api, server, web framework |

## Links

- npm: https://www.npmjs.com/package/miter
- Repository: https://github.com/miter-framework/miter
- Homepage: https://github.com/miter-framework/miter#readme
- Issues: https://github.com/miter-framework/miter/issues
- npm.io page: https://npm.io/package/miter

## Dependencies (25)

- [url](https://npm.io/package/url.md) ^0.11.0
- [path](https://npm.io/package/path.md) ^0.12.7
- [send](https://npm.io/package/send.md) ^0.15.2
- [debug](https://npm.io/package/debug.md) ^2.2.0
- [lodash](https://npm.io/package/lodash.md) ^4.16.4
- [parseurl](https://npm.io/package/parseurl.md) ^1.3.1
- [cli-color](https://npm.io/package/cli-color.md) ^1.1.0
- [encodeurl](https://npm.io/package/encodeurl.md) ^1.0.1
- [pluralize](https://npm.io/package/pluralize.md) ^3.0.0
- [@types/node](https://npm.io/package/@types/node.md) ^7.0.0
- [@types/send](https://npm.io/package/@types/send.md) ^0.14.2
- [body-parser](https://npm.io/package/body-parser.md) ^1.15.2
- [escape-html](https://npm.io/package/escape-html.md) ^1.0.3
- [express-jwt](https://npm.io/package/express-jwt.md) ^5.1.0
- [@types/lodash](https://npm.io/package/@types/lodash.md) ^4.14.37
- [@types/express](https://npm.io/package/@types/express.md) ^4.0.33
- [@types/parseurl](https://npm.io/package/@types/parseurl.md) ^1.3.1
- [@types/cli-color](https://npm.io/package/@types/cli-color.md) ^0.3.29
- [@types/pluralize](https://npm.io/package/@types/pluralize.md) ^0.0.27
- [reflect-metadata](https://npm.io/package/reflect-metadata.md) ^0.1.8
- [@types/body-parser](https://npm.io/package/@types/body-parser.md) ^0.0.33
- [@types/escape-html](https://npm.io/package/@types/escape-html.md) ^0.0.19
- [@types/express-jwt](https://npm.io/package/@types/express-jwt.md) ^0.0.33
- [continuation-local-storage](https://npm.io/package/continuation-local-storage.md) ^3.2.0
- [@types/continuation-local-storage](https://npm.io/package/@types/continuation-local-storage.md) ^3.2.0

## Recent versions

- 0.6.3 (latest) — 2018-03-03
- 0.6.2 — 2018-02-05
- 0.6.1 — 2018-02-05
- 0.6.0 — 2018-01-15
- 0.5.10 — 2018-01-06
- 0.5.9 — 2017-12-01
- 0.5.8 — 2017-11-30
- 0.5.7 — 2017-11-26
- 0.5.6 — 2017-11-24
- 0.5.5 — 2017-11-10
- 0.5.4 — 2017-10-27
- 0.5.3 — 2017-10-27
- 0.5.2 — 2017-10-25
- 0.5.1 — 2017-10-17
- 0.5.0 — 2017-09-15
- … 27 more at https://npm.io/package/miter/versions

## README

[![Build Status](https://travis-ci.org/miter-framework/miter.svg?branch=master)](https://travis-ci.org/miter-framework/miter)

# Miter Web Framework

Miter is a web framework heavily influenced by [Ruby on Rails][rails] and [SailsJs][sails]. It is built on top of [Express][express]. Miter uses Typescript's experimental decorators to create elegant controllers and services, using dependency injection to avoid tight coupling.

## Installation

Install `miter` using NPM.

```bash
npm install --save miter miter-cli
```

`miter-cli` is optional, but can be used to generate and run database migrations from the command line. See [miter-framework/miter-cli][miter_cli] for more details.

## Example

First, create a controller:

```typescript
import { Controller, Get } from 'miter';
import { Request, Response } from 'express';

@Controller()
class HelloWorldController {
    
    @Get('greet')
    async sampleRoute(req: Request, res: Response) {
        res.status(200).send(`Hello, World!`);
    }
    
}
```

Next, start the Miter server using `Miter.launch`:

```typescript
import { Miter } from 'miter';
import { HelloWorldController } from './hello-world.controller.ts';

Miter.launch({
    name: 'server-name',
    port: 8080,
    router: {
        controllers: [HelloWorldController]
    }
});
```

After you have launched your server, navigate to [localhost:8080/greet](example_url) to see your route in action.

This is a simple demonstration, but you can already see how simple and easy it is to get a server up and running.

## Contributing

Miter is a relatively young framework, and there are bound to be many ways that it can be improved. If you notice a bug, or would like to request a feature, feel free to [create an issue][create_issue]. Better yet, you can [fork the project][fork_miter] and submit a pull request with the added feature.

## Changelog

[See what's new][whats_new] in recent versions of Miter.

## Attribution

Special thanks to [BrowserStack][browserstack] for generously hosting our cross-browser integration tests!

[![BrowserStack](./attribution/browser-stack.png)][browserstack]

[rails]: http://rubyonrails.org/
[sails]: http://sailsjs.com/
[express]: https://expressjs.com/
[miter_cli]: https://github.com/miter-framework/miter-cli
[example_url]: http://localhost:8080/greet
[create_issue]: https://github.com/miter-framework/miter/issues/new
[fork_miter]: https://github.com/miter-framework/miter/pulls#fork-destination-box
[whats_new]: https://github.com/miter-framework/miter/blob/master/CHANGELOG.md
[browserstack]: https://www.browserstack.com

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