mirror of
https://github.com/cypress-io/cypress.git
synced 2026-05-22 16:18:45 -05:00
23 lines
544 B
CoffeeScript
23 lines
544 B
CoffeeScript
_ = require("lodash")
|
|
send = require("send")
|
|
runner = require("../../../runner")
|
|
pkg = require("../../package.json")
|
|
|
|
module.exports = {
|
|
serve: (req, res, config, getRemoteState) ->
|
|
config = _.clone(config)
|
|
config.remote = getRemoteState()
|
|
config.version = pkg.version
|
|
|
|
res.render runner.getPathToIndex(), {
|
|
config: JSON.stringify(config)
|
|
projectName: config.projectName
|
|
}
|
|
|
|
handle: (req, res) ->
|
|
pathToFile = runner.getPathToDist(req.params[0])
|
|
|
|
send(req, pathToFile)
|
|
.pipe(res)
|
|
}
|