Skip to content

Instantly share code, notes, and snippets.

View reecefenwick's full-sized avatar

Reece F reecefenwick

  • Brisbane, Australia
View GitHub Profile
public class AmazonServiceException extends AmazonClientException {
private static final long serialVersionUID = 1L;
private String requestId;
private String errorCode;
private AmazonServiceException.ErrorType errorType;
private String errorMessage;
private int statusCode;
private String serviceName;
private String rawResponseContent;
var Files = require('../services/FileService');
module.exports.deleteFile = function (req, res, next) {
var query = {createdBy: req.user._id, key: req.params.key};
var file = req.params._id;
Files.remove(query, file, function (err) {
if (err) return next(err);
res.status(204).json({});
@reecefenwick
reecefenwick / app.js
Last active August 11, 2016 00:17
tesseract example
var express = require('express');
var fs = require('fs');
var Busboy = require('busboy');
var mime = require('mime');
var tesseract = require('node-tesseract');
var app = express();
app.post('/upload', function(req, res) {
try {
@reecefenwick
reecefenwick / routes.js
Created April 13, 2015 04:23
Route configuration
/**
* routes.js
*
* @description :: TODO: You might write a short summary of how this model works and what it represents here.
* @docs ::
*/
var express = require('express');
var router = express.Router();
var Auth = require('../services/AuthService')
module.exports = {
login: function(req, res) {
Auth.login(req.body, function(err) {
if (err) return res.status(401).json({
message: 'You are not authorized'
})
res.status(200).json({