Skip to content

Commit c614bd3

Browse files
committed
Make app var global and export it
Mostly for future use by other projects
1 parent 064934c commit c614bd3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ const { getGraph, getGraphFromData, resStatus, serializeData } = require('./src/
1818

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

21+
var app;
22+
2123
var formats = {parsers: {}}
2224
formats.parsers['application/ld+json'] = JsonLdParser
2325
formats.parsers['text/turtle'] = N3Parser
@@ -205,7 +207,8 @@ function init(options){
205207
config = (options && options.config) ? options.config : config();
206208
console.log(config);
207209

208-
var app = createServer(config);
210+
// app is a global...also exported for using mayktso as an expres()
211+
app = createServer(config);
209212

210213
app.use(function(req, res, next) {
211214
res.header('X-Powered-By', mayktsoURI);
@@ -1422,4 +1425,5 @@ parseLinkHeader,
14221425
parseProfileLinkRelation,
14231426
getBaseURL,
14241427
getExternalBaseURL,
1428+
app
14251429
}

0 commit comments

Comments
 (0)