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

Export these REST API functions in node.js

I am trying to export some REST API functions out of a module. I am using node.js restify. I have a file called rest.js which contains the API. module.exports = { api_get: api_get, api_post: api_post, }; var api_get= function (app) { …
guagay_wk
  • 26,337
  • 54
  • 186
  • 295
0
votes
1 answer

Restify static webserver stops working after enabling HTTP basic authentication

I have a working node.js restify server configured to work as a static webserver. Here is the relevant code; var server = restify.createServer({ name: 'myapp', version: '1.0.0' }); var static_webserver = function (app) { app.get(/.*/,…
guagay_wk
  • 26,337
  • 54
  • 186
  • 295
0
votes
2 answers

What is the difference between reading query variables and body variables?

I am using node.js restify. There are 2 ways to read parameters from HTTP GET. Reading query variables. reading body variables. What is the difference between the 2? Under what situation should one use which?
guagay_wk
  • 26,337
  • 54
  • 186
  • 295
0
votes
1 answer

Is it necessary to place this line in every REST API for user authentication?

I would like to add user login authentication for my REST API server which was implemented in node.js restify. I intend to use this module restify-ensure-login. https://www.npmjs.com/package/restify-ensure-login I want all the API functions to…
guagay_wk
  • 26,337
  • 54
  • 186
  • 295
0
votes
1 answer

Using restify on website which requires user login authentication

I have been using restify as REST API server. I am also using angularjs with the front-end html, css, js files being hosted on an Apache webserver. I would like to add user login authentication to this webapp. Users need to login to gain access to…
guagay_wk
  • 26,337
  • 54
  • 186
  • 295
0
votes
3 answers

Restify - Best practice for accessing logger from a module

I have looked for the answer to this for a while and just have not come up with a solution. I understand that I have access to the builtin logger from req.log.xxxxx(...), but what about a module that I have required into my controller? For…
Aaron Wagner
  • 317
  • 1
  • 3
  • 15
0
votes
1 answer

what should be implemented in the facebook redirect uri?

I have an angular 1.5.0-rc0 application with satellizer in order to login to facebook. the website connects to a nodejs server at https://myalcoholist.com:8888 the website is https://myalcoholist.com to configure satellizer with facebook i have the…
ufk
  • 30,912
  • 70
  • 235
  • 386
0
votes
1 answer

requests.post isn't passing my string into the contents of my file

I am using a node.js restify server code that accepts text file upload and a python client code that uploads the text file. Here is the relevant node.js server code; server.post('/api/uploadfile/:devicename/:filename',…
guagay_wk
  • 26,337
  • 54
  • 186
  • 295
0
votes
1 answer

Keep to DRY in declaring HTTP and HTTPS REST server

I am using node.js Restify v4.0.3. The REST API server supports HTTP and HTTPS. Currently, the code for declaring the servers violates the DRY (don't repeat yourself) principle. Declaration code for HTTP server. var server = restify.createServer({ …
guagay_wk
  • 26,337
  • 54
  • 186
  • 295
0
votes
1 answer

Passing Node.JS res to a function?

This doesn't show any response to an HTTP request, just hangs: function middleware(req, res, next) { to_end(res).NotFound(); return next(); } This works: function middleware(req, res, next) { to_end(res).NotFound(); res.send(); //…
A T
  • 13,008
  • 21
  • 97
  • 158
0
votes
1 answer

Get error message from JsonClient

I created a JsonClient with node.js restify. var json_client = restify.createJsonClient({ url: 'http://127.0.0.1:8888', version: '~1.0' }); json_client.get('/test?list=' + test_list, function (err, req, res, test_list_results) { …
guagay_wk
  • 26,337
  • 54
  • 186
  • 295
0
votes
0 answers

What is wrong with this restify client code?

I have a server URL like this; http://127.0.0.1:8888/stk?list=XXX,YYY The server URL is tested to be working. I have a restify client that makes a HTTP GET to this URL and if things are working, a json output will be returned. This is how the…
guagay_wk
  • 26,337
  • 54
  • 186
  • 295
0
votes
1 answer

Retrieve query string parameters in node.js

I am trying to retrieve query string parameters from a URL. I am using node.js restify module. The URL looks like this; http://127.0.0.1:7779/echo?UID=Trans001&FacebookID=ae67ea324&GetDetailType=FULL The extracted relevant…
guagay_wk
  • 26,337
  • 54
  • 186
  • 295
0
votes
1 answer

how can I use a wildcard in restify routes

Being used to express i would write server.get('/*', controller); However i cannot write '/*' in Restify without getting a error, could someone please help me out here? A regex expression that could replace the wildcard (server.get(regex,…
andersfylling
  • 718
  • 10
  • 24
0
votes
0 answers

How to Implement Restify server.put?

Hi there I'm starting to Develop Restful API using Restify but I'm having problems developing [PUT]. My idea is to get the params and change it using the new params. But this code does not seem to work. Please help me out :D server.put('/user/:_id',…
Kenichi Shibata
  • 148
  • 2
  • 11