mirror of
https://github.com/status-im/embark-area-51.git
synced 2025-02-23 04:28:19 +00:00
move development server to boilerplate
This commit is contained in:
parent
0e43d903e6
commit
b44eb14028
@ -1,6 +1,7 @@
|
|||||||
module.exports = (grunt) ->
|
module.exports = (grunt) ->
|
||||||
|
|
||||||
grunt.loadNpmTasks "grunt-embark"
|
grunt.loadNpmTasks "grunt-embark"
|
||||||
|
grunt.loadTasks "tasks"
|
||||||
|
|
||||||
grunt.initConfig(
|
grunt.initConfig(
|
||||||
files:
|
files:
|
||||||
@ -103,3 +104,6 @@ module.exports = (grunt) ->
|
|||||||
# Loads all plugins that match "grunt-", in this case all of our current plugins
|
# Loads all plugins that match "grunt-", in this case all of our current plugins
|
||||||
require('matchdep').filterAll('grunt-*').forEach(grunt.loadNpmTasks)
|
require('matchdep').filterAll('grunt-*').forEach(grunt.loadNpmTasks)
|
||||||
|
|
||||||
|
grunt.registerTask "deploy", ["coffee", "deploy_contracts", "concat", "copy", "server", "watch"]
|
||||||
|
grunt.registerTask "build", ["clean", "deploy_contracts", "coffee", "concat", "uglify", "copy"]
|
||||||
|
|
||||||
|
22
boilerplate/tasks/server.coffee
Normal file
22
boilerplate/tasks/server.coffee
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
module.exports = (grunt) ->
|
||||||
|
express = require('express')
|
||||||
|
compress = require('compress')
|
||||||
|
readYaml = require('read-yaml')
|
||||||
|
|
||||||
|
grunt.registerTask "server", "static file development server", =>
|
||||||
|
serverConfig = readYaml.sync("config/server.yml")
|
||||||
|
|
||||||
|
webPort = serverConfig.port || 8000
|
||||||
|
webHost = serverConfig.host || 'localhost'
|
||||||
|
webRoot = "generated/dapp"
|
||||||
|
|
||||||
|
app = express()
|
||||||
|
app.use(compression())
|
||||||
|
app.use(express.static("" + (process.cwd()) + "/" + webRoot))
|
||||||
|
app.listen(webPort, webHost)
|
||||||
|
|
||||||
|
grunt.log.writeln("Running web server on port http://#{webHost}:#{webPort}")
|
||||||
|
|
||||||
|
return app
|
||||||
|
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user