Skip to content

Commit

Permalink
feat: flesh out readme
Browse files Browse the repository at this point in the history
  • Loading branch information
asos-craigmorten committed May 19, 2020
1 parent 28d575a commit 310e75d
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: benchmark doc fmt
.PHONY: benchmark doc fmt test

benchmark:
@./benchmarks/run.sh 1 ./benchmarks/middleware.ts
Expand Down
60 changes: 60 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,63 @@
# opine

An opinionated server for Deno ported from ExpressJS.

- [API Docs](https://asos-craigmorten.github.io/opine/) - created using [typedoc](https://typedoc.org/).
- [Contributing Docs](./.github/CONTRIBUTING.md)
- [Changelog](./.github/CHANGELOG.md)
- [License](./LICENSE.md)
- [ExpressJS License](./EXPRESS_LICENSE.md)

## Example

```ts
import opine from "https://raw.githubusercontent.com/asos-craigmorten/opine/master/mod.ts";
import {
Application,
Request,
Response,
NextFunction,
} from "https://raw.githubusercontent.com/asos-craigmorten/opine/master/typings/index.d.ts";

const app: Application = opine();

app.use((_req: Request, res: Response, _next: NextFunction): void => {
res.send("Hello World");
});

app.listen({ port: 3333 });
```

Run this example now using Deno the [opine-demo.ts](https://gist.github.com/asos-craigmorten/944d0d14130ac5d1f297829010836a73) gist.

```console
deno run --allow-net https://gist.githubusercontent.com/asos-craigmorten/944d0d14130ac5d1f297829010836a73/raw/2b755366ae37a0a6e255d43ec1d1d6401e9cf47c/opine-demo.ts
```

And open the browser at <http://localhost:3333/>.

## Developing

### Run Tests

```console
make test
```

### Run Benchmarks

```console
make benchmark
```

### Format Code

```console
make fmt
```

### Generate Documentation

```console
make doc
```

0 comments on commit 310e75d

Please sign in to comment.