Last active
December 10, 2015 06:18
-
-
Save jkeyes/4393079 to your computer and use it in GitHub Desktop.
Updated sample code for the "Stitch It Up" example from "The Little Book of CoffeeScript".
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict" | |
require("coffee-script") | |
stitch = require("stitch") | |
express = require("express") | |
argv = process.argv.slice(2) | |
pkg = stitch.createPackage( | |
# Specify the paths you want Stitch to automatically bundle up | |
paths: [ __dirname + "/app"], | |
# Specify your base libraries | |
dependencies: [ | |
# __dirname + '/lib/jquery.js' | |
] | |
) | |
app = express() | |
app.configure -> | |
app.set "views", __dirname + "/views" | |
app.use app.router | |
app.use express.static(__dirname + "/public") | |
app.get "/application.js", pkg.createServer() | |
port = argv[0] or process.env.PORT or 9294 | |
console.log("Starting server on port #{port}") | |
app.listen port |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Starting server on port 9294 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment