Skip to content

Instantly share code, notes, and snippets.

View harbhub's full-sized avatar

Michael Harbach harbhub

View GitHub Profile
<form action='/post' method="post">
<label for="POST-name">Post Name:</label>
<input id="POST-name" type="text" name="name">
<input id='POST-filename-upload' type='file' multiple='multiple'>
<input type="submit" value="Save">
</form>
var formidable = require('formidable');
//Listen for post request, then...
var form = new formidable.IncomingForm();
form.uploadDir = '/tmp';
form
.on('error', function(err) {
log('form error');
})
.on('field', function(field, value) {
log(field,value);
var timestamp=(function(){return (new Date()).getTime()})();
var log=function(data){console.log('Servant : '+data+' : '+timestamp);};
//var cap=function(string){string=(string).toString();return string.charAt(0).toUpperCase()+string.slice(1);};
log('Activated');
var http = require('http')
, fs = require('fs')
, ugly = require('uglify-js')
, mime = require('mime')
, formidable = require('formidable')
{
"name": "harbhub",
"domain": "harbhub.com",
"subdomain": "harbhubssl",
"scripts": {
"start": "server.js"
},
"version": "0.0.0-21",
"engines": {
"node": "0.8.x"
C:\Users\mike\testjitsu>jitsu deploy --debug
info: Welcome to Nodejitsu harbhub
info: jitsu v0.11.7, node v0.8.14
info: It worked if it ends with Nodejitsu ok
info: Executing command deploy
info: Analyzing application dependencies in server.js
debug: { method: 'GET',
debug: uri: 'https://api.nodejitsu.com/apps/harbhub/harbhub',
debug: headers:
debug: { Authorization: '*********************************',
C:\Users\mike\testjitsu>jitsu deploy
info: Welcome to Nodejitsu harbhub
info: jitsu v0.11.7, node v0.8.14
info: It worked if it ends with Nodejitsu ok
info: Executing command deploy
info: Analyzing application dependencies in server.js
warn: Local package version appears to be old
warn: The package.json version will be incremented automatically
warn: About to write C:\Users\mike\testjitsu\package.json
data:
if (x === 1) {
if (y ===1) {
z=1;
} else {z=2}
}
Michaels-MacBook-Pro:harbhub harbhub$ mongo
MongoDB shell version: 2.0.6
connecting to: test
>
CLIENT SIDE
$(document).ready(function () {
var myData = $('#myInput').val();
$.ajax({
url: 'http://localhost:8888/what',
Michaels-MacBook-Pro:harbhub harbhub$ jitsu deploy
info: Welcome to Nodejitsu harbhub
info: It worked if it ends with Nodejitsu ok
info: Executing command deploy
info: Analyzing your application dependencies in node app.js
info: Checking app availability harbhub.com
info: Creating app harbhub.com
info: Creating snapshot 0.0.1
error: Error running command deploy
error: Nodejitsu Error (500): Internal Server Error