'use strict'

class Endpoint {

    constructor({
        name,
        allowHeaders = ['authorization'],
        allowMethods = ['GET']
    }) {
        this._name = name
        this._path = '/cloudfoundryapplication/' + (name ? name + '/' : '')
        this._allowHeaders = allowHeaders.join(', ')
        this._allowMethods = allowMethods.join(', ')
    }

    getName() {
        return this._name
    }

    getPath() {
        return this._path
    }

    handle(req, res) {
        res.setHeader('Access-Control-Allow-Origin', '*')
        res.setHeader('Access-Control-Allow-Headers', this._allowHeaders)
        res.setHeader('Access-Control-Allow-Methods', this._allowMethods)
    }
}

module.exports = Endpoint
@@ -7,16 +7,28 @@
 trict'%0A%0A
+/**%0A * %0A */%0A
 class En
@@ -374,101 +374,359 @@
     
-getName() %7B%0A        return this._name%0A    %7D%0A%0A    getPath() %7B%0A        return this._path%0A    %7D%0A
+/**%0A     * %0A     * @returns %7Bstring%7D name of this endpoint%0A     */%0A    getName() %7B%0A        return this._name%0A    %7D%0A%0A    /**%0A     * %0A     * @returns %7Bstring%7D registered path of this endpoint%0A     */%0A    getPath() %7B%0A        return this._path%0A    %7D%0A%0A    /**%0A     * %0A     * @param %7Bhttp.ClientRequest%7D req %0A     * @param %7Bhttp.ClientResponse%7D res %0A     */
 %0A   

add jsdoc annotation