Skip to content

Commit

Permalink
Docs: Document all features
Browse files Browse the repository at this point in the history
  • Loading branch information
overlookmotel committed Jun 1, 2019
1 parent aaf8a1e commit 5b11b36
Showing 1 changed file with 48 additions and 1 deletion.
49 changes: 48 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,56 @@

Part of the [Overlook framework](https://overlookjs.github.io/).

## Abstract

[Overlook](https://overlookjs.github.io/) is a Javascript web framework.

It is composed of many modules which can be used together to build a fully-featured app. This module is the (very minimal) core.

This document only describes the methods of the core module. Please see other modules for documentation on each, or [overlookjs.github.io](https://overlookjs.github.io/) for an overview.

## Usage

This module is under development and not ready for use yet.
### Create app

```js
const Overlook = require('@overlook/core');
const app = new Overlook();
```

### Routes

The Route class defined by [@overlook/route](https://www.npmjs.com/package/@overlook/route) is exported as `Overlook.Route`.

See the docs for Route class methods [here](https://www.npmjs.com/package/@overlook/route).

#### `.attachRouter( router )`

Attach a router to the app.

```js
const {Route} = Overlook;
const router = new Route();
overlook.attachRouter( router );
```

### Initialization

#### `.init()`

Initialize the app.

This calls `.init()` on the router, passing the app as argument.

See [here](https://www.npmjs.com/package/@overlook/route#initialization) for details of the router initializaton process.

### Handling requests

#### `.handle( req )`

Handle request.

This calls `.handle()` on the router, passing the request as argument.

## Tests

Expand Down

0 comments on commit 5b11b36

Please sign in to comment.