Questions tagged [diet-js]

4 questions
3
votes
1 answer

How to listen to multiple urls with Diet.js?

The documentation for Diet.js demonstrates a basic web server as: var server = require('diet'); var app = server(); app.listen('http://localhost:8000'); app.get('/', function ($) { $.end('Hello World!'); }); The above code snippet…
myTerminal
  • 1,596
  • 1
  • 14
  • 31
2
votes
1 answer

Keep configurations for DietJS server

Rather than having to change the URL passed in diet.listen() method on every server that I deploy my application on, there should be a better way to maintain such parameters in the application. What options do we have to be able to manage such…
Kamran Ahmed
  • 7,661
  • 4
  • 30
  • 55
1
vote
1 answer

Reverse proxying subdomains to different ports on the same machine throws 404

I tried my hands on redbird like: var proxy = require('redbird')({port: 80}); proxy.register("http://www.example.com", "http://36.154.99.115:3000"); proxy.register("http://abc.example.com",…
Kamran Ahmed
  • 7,661
  • 4
  • 30
  • 55
1
vote
1 answer

DietJS: Respond with specific response code

Going through all of the tutorials of DietJS here: Diet.js | Tutorials, I am not able to find a way to respond with a particular response code. In the signals section, it is mentioned that we can use: $.failure(); And we can put in more information…
Kamran Ahmed
  • 7,661
  • 4
  • 30
  • 55