# teemserver

> Serves static content and proxies API calls

Latest version **1.1.0** (published 2015-06-17) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2015-06-17 |
| First published | 2015-04-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 18 |
| Known vulnerabilities | 0 (+3 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Dreem Teem |
| Maintainers | teem |
| Keywords | teem, dreem, server |

## Links

- npm: https://www.npmjs.com/package/teemserver
- Repository: https://github.com/teem2/server
- Issues: https://github.com/teem2/server/issues
- npm.io page: https://npm.io/package/teemserver

## Dependencies (18)

- [hbs](https://npm.io/package/hbs.md) ^2.7.0
- [tmp](https://npm.io/package/tmp.md) ^0.0.25
- [glob](https://npm.io/package/glob.md) 5.0.5
- [rovi](https://npm.io/package/rovi.md) ^0.0.1
- [async](https://npm.io/package/async.md) ^0.8.0
- [watch](https://npm.io/package/watch.md) ^0.14.0
- [sockjs](https://npm.io/package/sockjs.md) ^0.3.11
- [express](https://npm.io/package/express.md) ^4.10.5
- [limiter](https://npm.io/package/limiter.md) ^1.0.5
- [primus.io](https://npm.io/package/primus.io.md) ^3.1.2
- [uglify-js](https://npm.io/package/uglify-js.md) ^2.4.17
- [http-proxy](https://npm.io/package/http-proxy.md) ^1.7.3
- [compression](https://npm.io/package/compression.md) ^1.2.2
- [querystring](https://npm.io/package/querystring.md) ^0.2.0
- [ua-parser-js](https://npm.io/package/ua-parser-js.md) ^0.7.3
- [coffee-script](https://npm.io/package/coffee-script.md) ~1.9.2
- [express-http-proxy](https://npm.io/package/express-http-proxy.md) ^0.2.2
- [express-cache-control](https://npm.io/package/express-cache-control.md) ^1.0.2

## Recent versions

- 1.1.0 (latest) — 2015-06-17
- 1.0.14 — 2015-05-27
- 1.0.13 — 2015-04-29
- 1.0.12 — 2015-04-29
- 1.0.11 — 2015-04-29
- 1.0.10 — 2015-04-29
- 1.0.9 — 2015-04-26
- 1.0.8 — 2015-04-26
- 1.0.7 — 2015-04-26
- 1.0.6 — 2015-04-21
- 1.0.5 — 2015-04-21
- 1.0.4 — 2015-04-21
- 1.0.2 — 2015-04-17
- 1.0.1 — 2015-04-17

## README

## Teem Server

### Prerequisites

Install [Node.js v0.10.x](http://nodejs.org/download/)

Next, be sure to run this inside the server directory:

    npm install

If your machine doesn't have 'xmllint' available on the command-line, you'll need to install it. On Windows, a version of xmllint_windows is checked in (a small .NET application). This is based upon [xmllint for windows](https://code.google.com/p/xmllint/).

For best results, create a projects directory in the same location as your server and dreem directories. The projects directory is intended to give you a place to work that is independent of dreem.

### Running the tests

Be sure mocha is installed on your environment:

    npm install -g mocha
    
Then in the root directory, run the tests with:    

    mocha

### Starting the server

The Teem Server can be started either with `node server.js` or using the `./bin/teemserver` script, both of which accept environment variables for configuration, as follows:

`DREEM_ROOT` specifies the root to your local [Dreem](https://github.com/teem2/dreem) installation:

    DREEM_ROOT=../dreem/ node server.js

The optional `DEBUG` flag shows event bus information in the shell:

    DEBUG=true DREEM_ROOT=../dreem/ ./bin/teemserver

The optional `DREEM_PROJECTS_ROOT` flag will mount a projects directory at the root, e.g. [http://localhost:8080/projects/]()':

    DREEM_PROJECTS_ROOT=../projects/ DREEM_ROOT=../dreem/ ./bin/teemserver
    
If you have external components to load, place them all in a top-level directory and use the `DREEM_COMPONENTS_ROOT` variable to indicate where to find them:

    DREEM_COMPONENTS_ROOT="../workspace/components" ./bin/teemserver
    
Optional API keys that enable access to [Rovi APIs](http://prod-doc.rovicorp.com/mashery/index.php/Main_Page) 

    ROVI_SEARCH_SECRET=XXX ROVI_SEARCH_KEY=XXX DREEM_ROOT=../dreem/ ./bin/teemserver

To use Rovi APIs, prepend /api/ to the URL, e.g. 

[Top movies](http://localhost:8080/api/search/v2.1/amgvideo/filterbrowse?entitytype=movie&filter=editorialrating>8&filter=releaseyear>1500&&include=cast,images&size=1000)
[Top movie](http://localhost:8080/api/search/v2.1/amgvideo/filterbrowse?entitytype=movie&filter=editorialrating>8&filter=releaseyear>1500&&include=cast,images&size=1)
[Pivot to actor](http://localhost:8080/api/search/v2.1/amgvideo/search?entitytype=credit&include=filmography&query=Yoko+Maki)
[Pivot to other film](http://localhost:8080/api/search/v2.1/amgvideo/search?entitytype=video&include=cast&query=Hard+Romanticker)

See the [Rovi docs](http://prod-doc.rovicorp.com/mashery/index.php/Rovi-Data) for more info.

### Windows users
Install Node.js and run the application Node.js -> Node.js command prompt

Set the environment variables before running the server.

    set DEBUG=true
    set DREEM_ROOT=../dreem/
    node server.js


### Running demos
Once your server is running, the directory specified by DREEM_ROOT is served from the root URL, e.g. [http://localhost:8080/examples/timeline.html](). If you specified a project root, you should be able to run your examples from [http://localhost:8080/projects/](). Note that the server will not list the contents of directories, so you'll need to point to a specific html file, e.g. http://localhost:8080/examples/timeline.html

### Running all smoke tests from one URL
You can run [http://localhost:8080/smokerun]() to in a browser to run all smoketests one after the other without manual intervention, all errors are reported on the server commandline and not just the browser console.

### Troubleshooting
On OSX, if you see issues running 'npm install' that say something like 'Failed at the pty.js@0.2.3 install script' try running this on the command line:

    xcode-select --install

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