---
description: Getting started using the Octoris Node HTTP Framework
---

# Getting Started

## Installation

You can install Octoris via npm with

```bash
$ npm i octoris
```

## Core API

Octoris returns an object back which I like to consider the `core api`&#x20;

```javascript
{
  listen,
  methods,
  response,
  router,
  utils,
  debug
}
```

## Full Usage Example

{% code title="index.js" %}
```javascript
const { listen } = require('octoris')
const routes = require('./routes')

listen({ port: 3000 }, routes)
  .then(addr => console.log(`Server Listening on ${addr}`))
  .catch(console.error)
```
{% endcode %}

{% code title="routes.js" %}
```javascript
const { router, response, methods } = require('octoris')
const { send } = response
const { route, fixed, composeRoutes } = router
const { GET } = methods

function homeHandler () {
  return send(200, 'Hello Home!')
}

function aboutHandler () {
  return send(200, 'Hello About!')
}

const home = route([fixed('home')], [
  GET(homeHandler)
])

const about = route([fixed('about')], [
  GET(aboutHandler)
])

module.exports = composeRoutes({ logger: true }, [about, home])
```
{% endcode %}

And now you have a very simple starting server to work with!
