UNPKG

api-service-core

Version:

NodeJS api-service

46 lines 1.62 kB
"use strict"; /************************************************************************* * * Troven CONFIDENTIAL * __________________ * * (c) 2017-2019 Troven Pty Ltd * All Rights Reserved. * * NOTICE: All information contained herein is, and remains * the property of Troven Pty Ltd and its licensors, * if any. The intellectual and technical concepts contained * herein are proprietary to Troven Pty Ltd * and its suppliers and may be covered by International and Regional Patents, * patents in process, and are protected by trade secret or copyright law. * Dissemination of this information or reproduction of this material * is strictly forbidden unless prior written permission is obtained * from Troven Pty Ltd. */ Object.defineProperty(exports, "__esModule", { value: true }); const _ = require("lodash"); const express = require("express"); const assert = require("assert"); /** * bower_components * ---------------- * Serve static assets from ./bower_components/ * * @type {{name: string, title: string, description: string, fn: module.exports.fn}} */ class bower_components { constructor() { this.name = "api.bower_components"; this.title = "serve bower components on an endpoint"; } fn(operation, options) { let context = operation.context; assert(context, "missing context"); let cwd = process.cwd(); let static_options = _.extend({ redirect: false }, options); return express.static(cwd + 'bower_components', static_options); } } exports.default = bower_components; ; //# sourceMappingURL=bower_components.js.map