Skip to content

Commit

Permalink
Make app var global and export it
Browse files Browse the repository at this point in the history
Mostly for future use by other projects
  • Loading branch information
BigBlueHat committed May 31, 2017
1 parent 064934c commit c614bd3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ const { getGraph, getGraphFromData, resStatus, serializeData } = require('./src/

var handleResource = require('./src/server/middleware/handle-resource.js');

var app;

var formats = {parsers: {}}
formats.parsers['application/ld+json'] = JsonLdParser
formats.parsers['text/turtle'] = N3Parser
Expand Down Expand Up @@ -205,7 +207,8 @@ function init(options){
config = (options && options.config) ? options.config : config();
console.log(config);

var app = createServer(config);
// app is a global...also exported for using mayktso as an expres()
app = createServer(config);

app.use(function(req, res, next) {
res.header('X-Powered-By', mayktsoURI);
Expand Down Expand Up @@ -1422,4 +1425,5 @@ parseLinkHeader,
parseProfileLinkRelation,
getBaseURL,
getExternalBaseURL,
app
}

0 comments on commit c614bd3

Please sign in to comment.