molstar
Version:
A comprehensive macromolecular library.
25 lines • 878 B
JavaScript
/**
* Copyright (c) 2019 mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* @author Alexander Rose <alexander.rose@weirdbyte.de>
*/
import * as express from 'express';
import { getAbsoluteFSPath } from 'swagger-ui-dist';
import { interpolate } from '../../../mol-util/string';
import { indexTemplate } from './indexTemplate';
export function swaggerUiAssetsHandler(options) {
var opts = options || {};
opts.index = false;
return express.static(getAbsoluteFSPath(), opts);
}
function createHTML(options) {
return interpolate(indexTemplate, options);
}
export function swaggerUiIndexHandler(options) {
var html = createHTML(options);
return function (req, res) {
res.writeHead(200, { 'Content-Type': 'text/html; charset=utf-8' });
res.end(html);
};
}
//# sourceMappingURL=index.js.map