Questions tagged [restify]

restify is a module for use with node.js that facilitates the creation of REST web services.

resitfy enables developers to create a REST web services API on top of . restify borrows from the web application framework.

622 questions
0
votes
1 answer

pros and cons of using bodyparser nodejs file uploads

So what are the pros and cons of using bodyParser for file uploads? I mean with bodyParser I get the file into a /var/ directory and then I move it to my directory once its uploaded, it gives me easy access to the name file and other information,…
maumercado
  • 1,453
  • 4
  • 23
  • 47
0
votes
0 answers

Mongoose only saves certain fields (Mongoose + Restify)

This code won't save to my MongoDB. If I change doc.foursqure_key to doc.username or doc.password, it saves just fine. @User.findOne({ username: 'justin' }, (err, doc) => doc.foursquare_key = "your mom" doc.save() My User schema: …
framerate
  • 36
  • 5
0
votes
1 answer

nodejs restify error -- callback serving request treated as static function

I am initiating a node js web server with restify module. server = restify.createServer(); server.post('/getData', DataManager.getData); Handler for /getData path looks like this:- DataManager.prototype.getData = function(request, response, next)…
haltTm
  • 534
  • 1
  • 6
  • 25
0
votes
2 answers

Restify very simple JSONClient returns empty json

I just started using restify and tries to build a very simple JSONClient and fails on the first step. var restify = require('restify'); var client = restify.createJsonClient({ url: 'http://api.bgm.tv' }); client.get('/calendar', function(err,…
Mark Ni
  • 2,383
  • 1
  • 27
  • 33
0
votes
1 answer

Handling Accept headers in node.js restify

I am trying to properly handle Accept headers in RESTful API in node.js/restify by using WrongAcceptError as follows. var restify = require('restify') ; server = restify.createServer() // Write some content as JSON together with appropriate HTTP…
jpsecher
  • 4,461
  • 2
  • 33
  • 42
0
votes
1 answer

node: has no method create

I'm trying to test out a node/backbone tutorial at this git hub site $ git clone git://github.com/antoviaque/backbone-relational-tutorial.git. When I start the node server (by running command node app), I'm getting an error that a method create…
BrainLikeADullPencil
  • 11,313
  • 24
  • 78
  • 134
0
votes
1 answer

How do you use node-restify clients through a HTTP forward proxy like Squid?

I can use Node.js to make HTTP requests through Squid with a little gymnastics of path vs URL handling and header alteration: var http = require('http'); var host = "lvhubproxy01"; var options = { host: host, port: 3128, path:…
Alain O'Dea
  • 21,033
  • 1
  • 58
  • 84
0
votes
2 answers

Nodejs Restify Collection/Array param

I am in need to send multiple items over rest web service being developed over Nodejs + Restify. I can send single object e.g. User. Suppose, my app got 10 - 100 users at once and want to upload on server via Restful web service developed in…
Faisal Basra
  • 1,624
  • 4
  • 25
  • 40
0
votes
2 answers

Restify Cross Origin Basic Auth with AJAX

HTTP Basic Auth is working great when calling from my REST client. However, the app that is consuming the API is built w/ Backbone. We tried overriding Backbone sync to pass along the Authorization header but it is failing on an options call --…
Nick Parsons
  • 8,377
  • 13
  • 48
  • 70
0
votes
1 answer

Dual content type support in Restify

I'm running into a brick wall. I need my API to allow for both access via regular form post (application/x-www-form-urlencoded) and JSON (application/json). If the incoming request is application/json content type, I need to use req.body rather than…
Nick Parsons
  • 8,377
  • 13
  • 48
  • 70
0
votes
1 answer

Node.js EventEmitter error

I have an error when trying to inherit EvenEmitter /* Consumer.js */ var EventEmitter = require('events').EventEmitter; var util = require('util'); var Consumer = function() {}; Consumer.prototype = { // ... functions ... findById:…
jtomasrl
  • 1,430
  • 3
  • 13
  • 22
0
votes
2 answers

find object inside JSON using nested ID

i have a mongo collection like this {"stores": [{"name": "foo", "songs": [ {"id": "", "name": "", "artist": "", "category": "", "tags": []} ], "songsSchedule": [ { …
jtomasrl
  • 1,430
  • 3
  • 13
  • 22
0
votes
1 answer

Error deploying node js restify application to heroku

I'm having an issue deploying a restify application to Heroku. npm ERR! dtrace-provider@0.0.9 install: `node-waf clean ; node-waf configure build` npm ERR! `sh "-c" "node-waf clean ; node-waf configure build"` failed with 1 npm ERR! npm ERR! Failed…
Andy Williams
  • 105
  • 1
  • 4
0
votes
1 answer

node.js + restify - requiring client certificate

So I'm working on a basic node app. Clients will connect to it with SSL. It seems to work fine when I just use a server certificate, but when I attempt to require a client certificate, it continues to work no matter what I throw at it. I have found…
Chris
  • 1,013
  • 1
  • 15
  • 35
0
votes
2 answers

Nodejs: Expressjs and Restify structure

I planned to design a web app that provides apis and web site, this is because the app can be used with mobile. I'm currently using node-restify to provide the api, but now I need a way to serve dynamic pages of the app. My initial idea was to use…
piggyback
  • 9,034
  • 13
  • 51
  • 80
1 2 3
41
42