Skip to content

Commit

Permalink
Merge pull request #3 from Supernomad/chunked
Browse files Browse the repository at this point in the history
Chunked
  • Loading branch information
supernomad committed Jun 19, 2015
2 parents f3e24e2 + 3d76363 commit 78ae544
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,6 @@ build/Release
# Dependency directory
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
node_modules

# Temp directory for unit-tests
tmp
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[![GitHub license](https://img.shields.io/badge/license-GPL--3.0-green.svg)]()
[![GitHub version](https://badge.fury.io/gh/supernomad%2Fchunky.svg)](http://badge.fury.io/gh/supernomad%2Fchunky)
[![Coverage Status](https://coveralls.io/repos/Supernomad/chunky/badge.svg?branch=master)](https://coveralls.io/r/Supernomad/chunky?branch=master)
[![Build Status](https://travis-ci.org/Supernomad/chunky.svg?branch=master)](https://travis-ci.org/Supernomad/chunky)
[![Built with Grunt](https://cdn.gruntjs.com/builtwith.png)](http://gruntjs.com/)
# chunky
An async upload/download node library leveraging express.js and socket.io. Provides standard, chunked, and udp style transfers.
Empty file added libs/caching/localCache.js
Empty file.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "chunky",
"version": "0.0.1",
"version": "0.1.0",
"description": "An async upload/download nodejs library leveraging express.js and socket.io. Provides standard, chunked, and udp style transfers.",
"main": "chunky.js",
"scripts": {
Expand Down
39 changes: 39 additions & 0 deletions routes/chunked-download-routes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
var apiModels = require('./../libs/models/apiModels'),
typeHelper = require('./../libs/helpers/typeHelper'),
stringHelper = require('./../libs/helpers/stringHelper');

var debug = false,
routePrefix = "/chunked/download",
io = null,
dataCache = null;

var routes = {
"get": new apiModels.RouteHandler(routePrefix + "/:downloadId/:index", function (req, res) {

}),
"post": new apiModels.RouteHandler(routePrefix, function (req, res) {

}),
"delete": new apiModels.RouteHandler(routePrefix + "/:downloadId", function (req, res) {

}),
"error": new apiModels.ErrorHandler(function (error, req, res, next) {

})
};

function configure(cache, storage, options) {
if(typeHelper.isObject(options)) {
if(options.hasOwnProperty('debug') && typeHelper.isBoolean(options.debug)){
debug = options.debug;
}
if(options.hasOwnProperty('routePrefix') && typeHelper.isString(options.routePrefix)){
routePrefix = stringHelper.stripTrailingSlashes(options.routePrefix);
}
}

io = storage;
dataCache = cache;
return routes;
};
module.exports = configure;

0 comments on commit 78ae544

Please sign in to comment.