Skip to content
This repository has been archived by the owner on Mar 18, 2022. It is now read-only.

Error: CDN: missing option "undefined" #11

Closed
anandof28 opened this issue Jul 9, 2012 · 3 comments
Closed

Error: CDN: missing option "undefined" #11

anandof28 opened this issue Jul 9, 2012 · 3 comments

Comments

@anandof28
Copy link

I am wrong some were on this can some one please help me

/home/anand/node_modules/express-cdn/lib/main.js:33
throw new Error('CDN: ' + msg);
^
Error: CDN: missing option "undefined"
at /home/anand/node_modules/express-cdn/lib/main.js:33:9
at /home/anand/node_modules/express-cdn/lib/main.js:380:7
at Array.forEach (native)
at /home/anand/node_modules/express-cdn/lib/main.js:378:12
at Object. (/home/anand/Desktop/anandof86.me/app.js:23:32)
at Module._compile (module.js:446:26)
at Object..js (module.js:464:10)
at Module.load (module.js:353:31)
at Function._load (module.js:311:12)
at Array.0 (module.js:484:10)

@niftylettuce
Copy link
Collaborator

can you share a code snippet of your CDN config object and how you are requiring the module? please omit your S3 private credentials too.

@anandof28
Copy link
Author

@niftylettuce

here is my app.js code that produce me this error

var express = require('express');
var path = require('path');
var app = express.createServer();

var options = {
publicDir : path.join(__dirname, 'public')
, viewsDir : path.join(__dirname, 'views')
, domain : 'mycdnurl'
, bucket : 'bucket-name'
, key : 'key'
, secret : 'secret'
, hostname : 'localhost'
, port : 3000
, ssl : false
, production : true
};

var CDN = require('express-cdn')(app, options);

app.configure(function(){
app.set("view engine", "html");
app.register(".html", require("jqtpl").express);
app.use(express.bodyParser());
app.use(express.methodOverride());
app.use(express.logger());
app.use(app.router);
app.use(express.static(path.join(__dirname, 'public')));
});

app.dynamicHelpers({ CDN: CDN });

app.get('/', function(req, res) {
res.render('index');
});

app.listen(3000);

@niftylettuce
Copy link
Collaborator

app.router is supposed to go last btw as far as I know in terms of the order of your app.configure(...)

what version of express-cdn are you using?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants