You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Instantiate a Flatiron HTTP server.
var apiserver = flatiron.createApp({});
// Configure HTTP services with ecstatic for serving static files.
apiserver.use(flatiron.plugins.http, {
before: [
// Enable CORS via middleware.
require('../middleware/cors'),
],
// These headers are set globally.
headers: {
'X-Powered-By': 'Flatiron',
},
// Configure HTTPS if certs are specified.
https: app.config.get('server:https'),
});
app.use(flatiron.plugins.static, {
root: path.join(__dirname, '..', '..', 'public'),
});
Here's the full traceback:
/home/mikl/Work/Node.js/kartotekov/node_modules/flatiron/lib/flatiron/plugins/static.js:67
app.http.before = app.http.before.concat(st(options));
^
TypeError: Cannot read property 'before' of undefined
at exports.attach.app.static (/home/mikl/Work/Node.js/kartotekov/node_modules/flatiron/lib/flatiron/plugins/static.js:67:31)
at exports.attach (/home/mikl/Work/Node.js/kartotekov/node_modules/flatiron/lib/flatiron/plugins/static.js:80:15)
at App.use (/home/mikl/Work/Node.js/kartotekov/node_modules/flatiron/node_modules/broadway/lib/broadway/app.js:169:31)
at module.exports (/home/mikl/Work/Node.js/kartotekov/lib/commands/apiserver.js:36:7)
at executeCommand (/home/mikl/Work/Node.js/kartotekov/node_modules/flatiron/lib/flatiron/plugins/cli.js:297:19)
at Object.exports.commands.app.router.notfound (/home/mikl/Work/Node.js/kartotekov/node_modules/flatiron/lib/flatiron/plugins/cli.js:357:5)
at Router.dispatch (/home/mikl/Work/Node.js/kartotekov/node_modules/flatiron/node_modules/director/lib/director/cli.js:50:21)
at exports.attach.app.start (/home/mikl/Work/Node.js/kartotekov/node_modules/flatiron/lib/flatiron/plugins/cli.js:87:18)
at onComplete (/home/mikl/Work/Node.js/kartotekov/node_modules/flatiron/node_modules/broadway/lib/broadway/app.js:86:5)
at Object.exports.ensure (/home/mikl/Work/Node.js/kartotekov/node_modules/flatiron/node_modules/broadway/lib/broadway/features/index.js:10:10)
The text was updated successfully, but these errors were encountered:
I get a TypeError when I do this:
// Instantiate a Flatiron HTTP server.
var apiserver = flatiron.createApp({});
Here's the full traceback:
The text was updated successfully, but these errors were encountered: