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
var lessMiddleware = require("less-middleware"); | |
app.use(lessMiddleware({ | |
src: __dirname + "/less", | |
dest: __dirname + "/public/css", | |
// if you're using a different src/dest directory, you | |
// MUST include the prefex, which matches the dest | |
// public directory | |
prefix: "/css", | |
// force true recompiles on every request... not the |
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
/** | |
* Sends the output from the request to the response | |
* | |
* @param {Object} req The request | |
* @param {Object} res The response | |
*/ | |
var pipeRequest = function(req, res) { | |
req.on("error", function(error) { | |
// Here we handle errors connecting to the server in the proxy | |
if (error && error.code === "ECONNREFUSED") { |
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
return Backbone.View.extend({ | |
... | |
events: { | |
"click #submit-button": "submit" | |
}, | |
initialize: function() { | |
this.model.on( "sync", this.syncSuccess, this ); |
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
module.exports = function (grunt) { | |
grunt.loadNpmTasks('grunt-contrib-clean'); | |
grunt.loadNpmTasks("grunt-mocha-test"); | |
grunt.initConfig({ | |
pkg: grunt.file.readJSON('package.json'), | |
clean: ["test-reports.xml"], | |
mochaTest: { | |
"test": { |
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
var app, routingProxy, apiProxy, proxyHost, proxyPort; | |
var express = require("express"), | |
httpProxy = require("http-proxy"), | |
fs = require("fs"); | |
// Should we dynamically define these by environment? | |
proxyHost = "localhost"; | |
proxyPort = "8080"; | |
// Create and define the Express server |
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
#!upstart | |
description "nodemon server for myapp" | |
author "ubuntu" | |
start on startup | |
stop on shutdown | |
script | |
export HOME="/home/ubuntu/git/myapp" |
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
/* | |
* CLIENT SIDE CODE | |
*/ | |
// perform a file upload | |
file = this.$("input[name='image-file']").prop("files")[0]; | |
formData = new FormData(); | |
formData.append("image", file); | |
$.ajax({ |
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
/* | |
* MODEL CODE | |
*/ | |
formSubmit: function(ev) { | |
var formValues; | |
ev.preventDefault(); | |
formValues = this.$("form").serializeObject(); | |
this.model.save(formValues); |
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
/* | |
* MODEL | |
*/ | |
return Backbone.Model.extend({ | |
urlRoot: "/api/resource", | |
defaults: { | |
id: null, | |
name: null, | |
num: null, |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE project> | |
<Context> | |
<Resource name="jdbc/web" | |
auth="Container" | |
type="javax.sql.DataSource" | |
factory="org.apache.tomcat.jdbc.pool.DataSourceFactory" | |
testWhileIdle="true" | |
testOnBorrow="true" | |
testOnReturn="false" |
OlderNewer