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

How do you serve a directory listing from restify?

How do you get Restify to serve directory listings? It seems to be possible to serve the contents of a directory, but not actually list them.
Fergie
  • 5,933
  • 7
  • 38
  • 42
0
votes
1 answer

How to submit form data using restify and post?

I want to print an input value using restify and post route, but it's not working. The form.html page opens and upon submitting, I see this in URL: http://localhost:8081/?name=dsf But I don't see any message in console. Am I doing something…
user3.14
  • 371
  • 2
  • 15
0
votes
2 answers

How do I define Watershed in Node.js?

When I execute the following code, I get the error: Reference Error: Watershed is not defined. How can I define it? Do I need a module to be installed for it? var restify=require('restify'); var ws= new Watershed(); var…
user3.14
  • 371
  • 2
  • 15
0
votes
1 answer

How is filled request.header.authorization?

I'm passing from express to restify and I wrote a module to check my authorization that used express-session and before it worked well. Now, on restify, the request.headers.authorization return undefined so my question is: can I add some code to…
Filippo1980
  • 2,745
  • 5
  • 30
  • 44
0
votes
1 answer

Restify exception being mysteriously thrown

I have the following Restify route handler defined. MyModule.prototype.uploadDateChecker = function (req, res, next) { req.locals = {}; var handlerConfig = req._self = this; //Uncommenting this line does throw the exception with the…
user994165
  • 9,146
  • 30
  • 98
  • 165
0
votes
1 answer

MySQL DB Pool with Node.js and Restify

I am currently developing a node.js backend for a mobile app with potentially many users. However it's my first time in developing node.js. I was following a tutorial on how to connect to a mysql database via mysql pools. I am able to create a…
theXs
  • 437
  • 8
  • 25
0
votes
1 answer

Azure rewrite rules causing error 404 in detailed logs

I have a website with the following structure at the root for a Node.js app package.json server.js public index.html css js images ...other folders I would like to take the person only inside the public folder with a forced HTTPS…
PirateApp
  • 5,433
  • 4
  • 57
  • 90
0
votes
1 answer

Restify : how do I present a prefilled signin form?

Here is my flow. I have a form (html template with js code ) that needs to be prefilled with some user properties and presented on the path /signup These properties are passed as url params. There is a javascript in the page that will read this url…
ubreddy
  • 815
  • 2
  • 8
  • 19
0
votes
0 answers

Attach /extend database object to Restify server or request

What would be considered a best practice to extend restify with a db object that can be used in every route? Ideally I would want to do something similar to this express practice. const app = express(); app.use('/api/users',…
eljefedelrodeodeljefe
  • 6,304
  • 7
  • 29
  • 61
0
votes
1 answer

Node.js Restify code is executed after returning error

I have a router handler configured in a Restify route. In that handler I make a call to a custom module where I do some error checking. When I hit an error condition, I my code returns next(err). I see the error message in the browser, but for…
user994165
  • 9,146
  • 30
  • 98
  • 165
0
votes
2 answers

Getting the Restify Handler Object using "this"

I set up a Restify route using the following code. I create a pseudoclass, instantiate the object and use that as the handler. I want the object itself to be bound to "this" in the "ping" function so I have access to the member variables. …
user994165
  • 9,146
  • 30
  • 98
  • 165
0
votes
2 answers

MongoDB + node: not authorized to execute command (sometimes works, sometimes doesn't)

I'm facing a problem with my MongoDB environment - the setup is as follows: My node app provides a restify API which handles user registration (look up if a user exists in a collection based on his mail, and if not, insert him (note - insert uses…
Zahlii
  • 818
  • 1
  • 7
  • 17
0
votes
1 answer

Restify JsonClient URL x Path

When I create a JsonClient in node I do the following: var client = restify.createJsonClient({ url: 'https://www.domain.com:4321/api' }); Once I've done that, I make calls like so: client.post('/service/path', { }); Which seems right. I expect…
Bruno Brant
  • 8,226
  • 7
  • 45
  • 90
0
votes
2 answers

Why does mocha timeout when used with restify and knex?

I'm presently using mocha 2.5.3, supertest 2.0.0, knex 0.11.10, restify 4.1.1 and sqlite3 3.1.4. I have the following very simple restify server: const restify = require('restify'); const knex = require('knex')({ client: 'sqlite3', connection:…
user2250201
0
votes
1 answer

How to send csv file using restify

here is a simple questions: I need to export an array into csv and send it as a file response using restify. Following implementation, obviously not working var result = fileUploadSvc.exportCSVData(data); res.writeHead(200, { …
SkSirius
  • 156
  • 1
  • 9