Skip to content

Commit

Permalink
Merge branch 'master' into generators
Browse files Browse the repository at this point in the history
  • Loading branch information
evantahler committed Mar 15, 2015
2 parents d714837 + 4b8629e commit df33778
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion README.md
@@ -1,4 +1,4 @@
# actionhero.js ![NPM Version](https://img.shields.io/npm/v/actionhero.svg?style=flat) ![Node Version](https://img.shields.io/node/v/actionhero.svg?style=flat) [![NPM](https://img.shields.io/npm/dm/actionhero.svg?style=flat)](https://npmjs.org/package/actionhero)
# actionhero.js [![NPM Version](https://img.shields.io/npm/v/actionhero.svg?style=flat)](https://www.npmjs.com/package/actionhero) ![Node Version](https://img.shields.io/node/v/actionhero.svg?style=flat) [![NPM](https://img.shields.io/npm/dm/actionhero.svg?style=flat)](https://npmjs.org/package/actionhero)

## The Reusable, Scalable, and Quick node.js API Server

Expand Down
14 changes: 7 additions & 7 deletions config/servers/websocket.js
@@ -1,23 +1,23 @@
// Note that to use the websocket server, you also need the web server enabled

exports.default = {
exports.default = {
servers: {
websocket: function(api){
return {
enabled: true,
// you can pass a FQDN (string) here or 'window.location.origin'
clientUrl: 'window.location.origin',
// Directory to render client-side JS.
clientUrl: 'window.location.origin',
// Directory to render client-side JS.
// Path should start with "/" and will be built starting from api.config..general.paths.public
clientJsPath: 'javascript/',
// the name of the client-side JS file to render. Both `.js` and `.min.js` versions will be created
// do not include the file exension
// set to `null` to not render the client-side JS on boot
// set to `undefined` to not render the client-side JS on boot
clientJsName: 'actionheroClient',
// should the server signal clients to not reconnect when the server is shutdown/reboot
destroyClientsOnShutdown: false,

// Primus Server Options:
// Primus Server Options:
server: {
// authorization: null,
// pathname: '/primus',
Expand All @@ -32,7 +32,7 @@ exports.default = {
// exposed: false,
},

// Priumus Client Options:
// Priumus Client Options:
client: {
apiPath: '/api', // the api base endpoint on your actionhero server
// reconnect: {},
Expand All @@ -49,4 +49,4 @@ exports.default = {
}
}
}
}
}
2 changes: 1 addition & 1 deletion initializers/resque.js
Expand Up @@ -80,7 +80,7 @@ module.exports = {

// multiWorker emitters
self.multiWorker.on('internalError', function(error){ api.log(error, 'error'); })
self.multiWorker.on('multiWorkerAction', function(verb, delay){ api.log('*** checked for worker status: ' + verb + ' (event loop delay: ' + delay + 'ms)', 'debug'); })
self.multiWorker.on('multiWorkerAction', function(verb, delay){ api.log('*** checked for worker status: ' + verb + ' (event loop delay: ' + delay + 'ms)', 'trace'); })

if(api.config.tasks.minTaskProcessors > 0){
self.multiWorker.start(function(){
Expand Down
4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -2,7 +2,7 @@
"author": "Evan Tahler <evantahler@gmail.com>",
"name": "actionhero",
"description": "actionhero.js is a multi-transport API Server with integrated cluster capabilities and delayed tasks",
"version": "10.0.5",
"version": "10.1.0",
"homepage": "http://actionherojs.com",
"repository": {
"type": "git",
Expand Down Expand Up @@ -35,7 +35,7 @@
"formidable": "~1.0.14",
"grunt": "~0.4.2",
"mime": "~1.3.4",
"node-resque": "0.11.6",
"node-resque": "0.11.9",
"node-uuid": "~1.4.1",
"optimist": "~0.6.1",
"primus": "~2.4.0",
Expand Down
2 changes: 1 addition & 1 deletion servers/web.js
Expand Up @@ -100,7 +100,7 @@ var initialize = function(api, options, next){
connection.rawConnection.responseHeaders.push(['Content-Type', mime]);
connection.rawConnection.responseHeaders.push(['Content-Length', length]);
if(foundExpires === false) { connection.rawConnection.responseHeaders.push(['Expires', new Date(new Date().getTime() + api.config.servers.web.flatFileCacheDuration * 1000).toUTCString()]); }
if(foundCacheControl === false) { connection.rawConnection.responseHeaders.push(['Cache-Control', 'max-age=' + api.config.servers.web.flatFileCacheDuration + ', must-revalidate']); }
if(foundCacheControl === false) { connection.rawConnection.responseHeaders.push(['Cache-Control', 'max-age=' + api.config.servers.web.flatFileCacheDuration + ', must-revalidate, public']); }

cleanHeaders(connection);
var headers = connection.rawConnection.responseHeaders;
Expand Down
16 changes: 8 additions & 8 deletions servers/websocket.js
Expand Up @@ -83,7 +83,7 @@ var initialize = function(api, options, next){
length : length
};

try{
try{
if(!error){
fileStream.on('data', function(d){ content+= d; });
fileStream.on('end', function(){
Expand Down Expand Up @@ -144,7 +144,7 @@ var initialize = function(api, options, next){
if(!minimize){ minimize = false; }
var libSource = api.servers.servers.websocket.server.library();
var ahClientSource = server.compileActionheroClientJS();
ahClientSource =
ahClientSource =
';;;\r\n' +
'(function(exports){ \r\n' +
ahClientSource +
Expand All @@ -156,19 +156,19 @@ var initialize = function(api, options, next){
return UglifyJS.minify(libSource + '\r\n\r\n\r\n' + ahClientSource, {fromString: true}).code;
}else{
return (libSource + '\r\n\r\n\r\n' + ahClientSource);
}
}
}

server.writeClientJS = function(){
if(!api.config.general.paths.public || api.config.general.paths.public.length === 0){
return;
}
if(api.config.servers.websocket.clientJsPath !== undefined && api.config.servers.websocket.clientJsName !== undefined){
if(api.config.servers.websocket.clientJsPath && api.config.servers.websocket.clientJsName){
var base = path.normalize(
api.config.general.paths.public[0] +
path.sep +
api.config.servers.websocket.clientJsPath +
path.sep +
api.config.general.paths.public[0] +
path.sep +
api.config.servers.websocket.clientJsPath +
path.sep +
api.config.servers.websocket.clientJsName
);
try{
Expand Down

0 comments on commit df33778

Please sign in to comment.