mirror of
https://github.com/cypress-io/cypress.git
synced 2026-02-19 05:31:40 -06:00
23 lines
545 B
CoffeeScript
23 lines
545 B
CoffeeScript
_ = require("lodash")
|
|
send = require("send")
|
|
runner = require("@packages/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)
|
|
}
|