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
42 changes: 42 additions & 0 deletions Gruntfile.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
module.exports = (grunt) ->

# load all grunt tasks
require("matchdep").filterDev("grunt-*").forEach grunt.loadNpmTasks

devPort = 3000

grunt.initConfig
watch:
scripts:
files: '**/*.js'
options: { nospawn: true }
tasks: ["develop", "watch"]

develop:
server:
file: 'main.js'
cmd: 'node'
nodeArgs: ['--debug-brk']
env:
NODE_ENV: 'devel'
PORT: devPort

exec:
reqs: "export NODE_ENV=devel && export PORT=#{devPort} && \
mocha --timeout=3000 --compilers coffee:coffee-script/register \
test/main.coffee"

coffeelint:
app: ["{,*/}*.coffee", "lib/controllers/{,*/}*.coffee"]

mochaTest:
test:
options:
require: ["coffee-script"]

src: ["test/main.coffee"]


grunt.registerTask "test", ["coffeelint", "mochaTest:test"]
grunt.registerTask "run", ["develop", "watch"]
grunt.registerTask "default", ["run"]
31 changes: 14 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
# brewtus


[![build status](https://travis-ci.org/vencax/brewtus.svg)](https://travis-ci.org/vencax/brewtus)


[TUS Protocol 0.2.1](http://www.tus.io/protocols/resumable-upload.html) Server Implementation


## Configuration
edit brewtus.json
```js
{
"host": "192.168.1.117",
"port": 8080,
"server": "BrewTUS/0.1",
"files": "files",
"logDir": "logs",
"logRotateSize": 10485760,
"logLevel": "info"
}
```
- Allowed [log levels](https://github.com/flatiron/winston#using-logging-levels): debug, info, warn, error
- LogRotateSize: 10MB default

through few environment variables:

- PORT: port on this server will sit (default: 1080)
- FILESDIR: path to folder where the files will land (default: 'files' folder within this project)
- SERVERSTRING: content of "server" header sent back to clients (default: 'BrewTUS/0.1')
- BTUSPLUGIN: require string with custom plugin implementation (optional)


## Install
```
Expand All @@ -27,8 +25,7 @@ npm install
## Run

```
coffee -c *.coffee
node brewtus.js
node server.js
```

## Test/Try out
Expand All @@ -40,7 +37,7 @@ http://127.0.0.1:8080/

or

Command line
Command line
Get [tuspy](https://github.com/vayam/tuspy) client
```
python tuspy.py -f <file>
Expand Down
269 changes: 0 additions & 269 deletions brewtus.coffee

This file was deleted.

9 changes: 0 additions & 9 deletions brewtus.json

This file was deleted.

Loading