Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
language: node_js
sudo: false
before_script:
- npm install
- npm install -g mocha
node_js: 4
script:
- mocha test
17 changes: 17 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM node:4-onbuild

# Create app directory
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app


# Install app dependencies

# mocha global [todo: do we need this to be global?]
RUN npm install -g mocha

ONBUILD COPY package.json /usr/src/app/
ONBUILD RUN npm install
ONBUILD COPY . /usr/src/app

CMD [ "npm", "test" ]
28 changes: 27 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# leftpad-sdk
# leftpad-sdk [![Build Status](https://travis-ci.org/ayc/leftpad-sdk.svg?branch=master)](https://travis-ci.org/ayc/leftpad-sdk)

We were all saddened and shocked by the sudden disappearance of the `left-pad` NPM module. We were lost and unable to left-pad our strings, until one adventurous person decided to develop a RESTful API to offer that same functionality under a revolutionary new technology called SMaaS (String Manipulation as a Service). Believe you me, this is going to be bigger than The Cloud. You can read more about it on its site: http://left-pad.io/

Expand All @@ -24,4 +24,30 @@ promise.then(function(ret) { console.log(ret.body.str) })
```
similarly to the previous example, this will print `#########hello world`.

### Testing

Tests are handled by [mochajs](http://mochajs.org/). To install with npm:
```
npm install -g mocha
```

To run tests simply:
```
npm test
```

### Docker

If you wish to run test without installing anything on your local machine, run it behind a [docker](https://www.docker.com/) container.

Just build your image
```
docker build -t leftpad .
```

And run it
```
docker run leftpad
```

That's all.