add driver lib for serving driver dist

This commit is contained in:
Brian Mann
2017-05-09 11:33:36 -04:00
parent d7a996a9bb
commit 6e1e3f72ab
6 changed files with 29 additions and 20 deletions
@@ -0,0 +1,10 @@
send = require("send")
driver = require("../../../driver")
module.exports = {
handle: (req, res) ->
pathToFile = driver.getPathToDist(req.params[0])
send(req, pathToFile)
.pipe(res)
}
+4
View File
@@ -9,6 +9,7 @@ xhrs = require("./controllers/xhrs")
client = require("./controllers/client")
files = require("./controllers/files")
proxy = require("./controllers/proxy")
driver = require("./controllers/driver")
staticCtrl = require("./controllers/static")
module.exports = (app, config, request, getRemoteState, watchers, project) ->
@@ -29,6 +30,9 @@ module.exports = (app, config, request, getRemoteState, watchers, project) ->
app.get "/__cypress/runner/*", (req, res) ->
runner.handle(req, res)
app.get "/__cypress/driver/*", (req, res) ->
driver.handle(req, res)
app.get "/__cypress/static/*", (req, res) ->
staticCtrl.handle(req, res)
-18
View File
@@ -136,24 +136,6 @@ watchSpecs = ->
gulp.watch "test/**/*_spec.coffee", (event) ->
server.runSpec(event.path)
# gulp.task "app:img", ["vendor:img", "project:img", "project:favicon", "project:logo"]
# gulp.task "vendor:img", ->
# gulp.src("node_modules/jquery-ui/themes/smoothness/images/**")
# .pipe gulp.dest "lib/public/css/images"
#
# gulp.task "project:img", ->
# gulp.src("app/img/**/*")
# .pipe gulp.dest "lib/public/img"
#
# gulp.task "project:favicon", ->
# gulp.src(cyIcons.getPathToFavicon("**/*"))
# .pipe gulp.dest "lib/public/img"
#
# gulp.task "project:logo", ->
# gulp.src cyIcons.getPathToIcon("icon_128x128@2x.png")
# .pipe gulp.dest "lib/public/img"
gulp.task "app:js", ->
compileJs()
+1
View File
@@ -0,0 +1 @@
module.exports = require("./lib/driver")
+13
View File
@@ -0,0 +1,13 @@
var path = require('path')
function dist () {
var args = [].slice.call(arguments)
var paths = [__dirname, '..', 'dist'].concat(args)
return path.join.apply(path, paths)
}
module.exports = {
getPathToDist: function(){
return dist.apply(null, arguments)
},
}
+1 -2
View File
@@ -14,8 +14,7 @@
<div id="app"></div>
<script type="text/javascript" src="/__cypress/socket.io.js"></script>
<script type="text/javascript" src="/__cypress/static/js/vendor.js"></script>
<script type="text/javascript" src="/__cypress/static/js/cypress.js"></script>
<script type="text/javascript" src="/__cypress/driver/driver.js"></script>
<script type="text/javascript" src="/__cypress/runner/runner.js"></script>
<script type="text/javascript">
$(function(){