This file contains hidden or 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
it('creates a new collection with an image as a binary buffer', function(done) { | |
var endpoint = '/collections'; | |
var url = SERVER_URL + endpoint; | |
var method = 'POST'; | |
var form = new FormData(); | |
form.append('json', {"name": "Red stuff collection","filter": {"colour": "red"}}); | |
form.append('image', require('fs').readFileSync('./test/data/image.jpg')); | |
This file contains hidden or 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 restify = require('restify'); | |
// Authentication | |
var passport = require('passport'); | |
var LocalStrategy = require('passport-local').Strategy; | |
var sessions = require("client-sessions"); | |
var server = restify.createServer(); | |
server.use(restify.queryParser()); | |
server.use(restify.bodyParser()); |