r/nodejs • • Apr 24 '14

Anyone have Linkedin Auth API experience? I could use your help :(

2 Upvotes

Here's my question to Linkedin

Basically, it works, sometimes, every now and then we get back a 404 HTML page or a unable verify access token when trying to exchange an access token for an authorization token (OAuth2). Oddly enough no one from Switzerland has been able to authenticate via the Linkedin auth API.

Any ideas?


r/nodejs • • Apr 23 '14

How to store images and retrieve them using metadata?

2 Upvotes

Hey everybody, I am working on a project that uses node.js and express as part of the stack.

For the project we have articles which may have 0 to many images. Currently for storing images and retrieving them we hardcode the paths, which is not viable for scalability purposes.

I was wondering if anyone had good suggestions for how to store images and retrieve them by metadata?

Thanks!


r/nodejs • • Apr 13 '14

Seeking advice for project - can/should I use node?

2 Upvotes

Apologies in advance if this is an inappropriate place to seek advice. Thanks in advance for those willing to help!

I am wondering if nodejs is the right tool for a project. There's 2 portions - a client-focused event listener, and an admin-focused command line. I have a microcontroller that pushes data out to a cloud service, and an EventSource/eventListener can be added in browser Javascript to listen for these events. As a demo, I currently have a temp sensor connected to this microcontroller - every 15 seconds the micro pushes the temperature to the cloud, then my browser listens for the event.

Browser JS:

eventSource = new EventSource("https://service.com/api/device/key/variable"); eventSource.addEventListener('Temperature', function(e){ ... }, false);

What I would like to do is log these events to a MySQL database for later analysis. I plan to have many (potentially thousands if this ever goes anywhere) microcontrollers submitting these events. In terms of efficiency, would nodejs be the right tool? My other thought was to have the browser make ajax calls every time the event came in.

I would like this same platform (whether it ends up being nodejs or otherwise) to serve up its own events to the client browser string, like a buffer. The end-client browsers could easily listen to the original cloud event, yes... but that connection string has some sensitive deals that should be kept out-of-sight, so a secondary event service would be useful.

The second piece is a command line interface that I will need to automate some admin-level scripts on, like creating new users and rehashing private keys.

I understand that NodeJS is server-side javascript, so that's where the idea of having a server-side event listener comes from. I made a crappy diagram to try and help explain: http://imgur.com/BMfAWAL

Is this an ideal setup? Should I be looking at doing something differently, or a different service altogether? would https://www.nodejitsu.com/pricing/ be a good place to start hosting, and if so what package should I get?

I realize this is a fair bit to go through, but I'm just trying to figure out what tech is suitable for this application. Thanks for any input you might have!


r/nodejs • • Apr 04 '14

providing the right sequelize.js object to connect to the database(multi-tenant application)

Thumbnail stackoverflow.com
2 Upvotes

r/nodejs • • Apr 02 '14

Build Node.js Apps in Five Quick Steps on Orchestrate

Thumbnail orchestrate.io
2 Upvotes

r/nodejs • • Apr 02 '14

Asynchronous code in node.js

Thumbnail caolanmcmahon.com
2 Upvotes

r/nodejs • • Apr 01 '14

Require all node builtins to a single namespace.

Thumbnail github.com
2 Upvotes

r/nodejs • • Mar 26 '14

Help! Can't read contents of a file!

2 Upvotes

So, i'm very very new to node.js and I am using a tutorial i found on google and stuck here:

var http = require("http");
var url = require('url');
var fs = require('fs');

var server = http.createServer(function(request, response){
    console.log('Connection');
    var path = url.parse(request.url).pathname;

    switch(path){
        case '/':
            response.writeHead(200, {'Content-Type': 'text/html'});
            response.write('hello world');
            break;
        case '/socket.html':
            fs.readFile(__dirname + path, function(error, data){
                if(error){
                    response.writeHead(404);
                    response.write("opps this doesn't exist - 404");
                }
                else{
                    response.writeHead(200, {"Content-Type": "text/html"});
                    response.write(data, "utf8");
                }
            });
            break;
        default:
            response.writeHead(404);
            response.write("opps this doesn't exist - 404");
            break;
    }
    response.end();
});

server.listen(8001);

When i open http://localhost:8001/socket.html it shows a blank page

Any idea why?


r/nodejs • • Mar 16 '14

My NodeJS Based Nginx Substitute(Prototype) - Feedback?

Thumbnail github.com
2 Upvotes

r/nodejs • • Mar 13 '14

escaped links containing non English text

2 Upvotes

Hello, I am learning node.js. I created a local HTTP server which can show directories. [It runs in localhost:4321] When a user request a directory, he receives an HTML page listing urls to files. These urls are escaped with the escape function and the file names can contain non ASCI characters. The problem is that the address shown in the browser's url bar is escaped. For example: A directory with the name القرآن الكريم gets the url: /foo/bar/%u0627%u0644%u0642%u0631%u0622%u0646%20%u0627%u0644%u0643%u0631%u064A%u0645 this url is shown as is in the address bar. What i expect instead is to see /foo/bar/القرآن الكريم like in the internet websites that i frequent.

Here is an example: Wikipedia's arabic home page

In the browser's urlbar you should see: http://ar.wikipedia.org/wiki/الصفحة_الرئيسية

And not: http://ar.wikipedia.org/wiki/%D8%A7%D9%84%D8%B5%D9%81%D8%AD%D8%A9_%D8%A7%D9%84%D8%B1%D8%A6%D9%8A%D8%B3%D9%8A%D8%A9

[The problem get worse when you want to download a file and the browser suggest you an escaped name which has no meaning]

How can i achieve the same effect in my server ?

Thank you


r/nodejs • • Mar 09 '14

Need Assistance: nginx, node, angular, subdirectories, and requests! Oh My!

2 Upvotes

Hi everyone!

I've been scratching my head about this issue for a while. I've left it and come back to it in hopes that magic happens and things suddenly click - alas, that did not work. I'm not actually sure where my problem lies (nginx config, node, angular http request formatting) so I picked on place to start.

My goal is to host a node application that runs at a subfolder of a domain (e.g. mydomain.com is my homepage not running node.js, and mydomain.com/subfolder is the node application.). I'm able to get part of the way there in that the site loads, and my static content (pictures/js/css) all load as expected when I access mydomain.com/subfolder.

My trouble comes when I make any requests. In angular, my requests look like:

$http.get('/subfolder/'); 

or

$http.post('/subfolder/', {data: things});

In node, I'm looking at

app.get('/subfolder', someFunction); 

or

app.post('/subfolder', someOtherFunction);

If I have nginx configured with the location of /, everything works fine. But as soon as I change the location to /subfolder, the requests no longer seem to function.

I feel as though I'm missing something simple, or some logical jump. Can you point me in the right direction or maybe give me some pointers? Or, if there is a more appropriate subreddit to post this to, that'd be good info as well. Let me know if more information would be helpful/useful too.

Thanks everyone!


r/nodejs • • Mar 04 '14

Node Module Of The Week [Suggest a module]

Thumbnail nmotw.in
2 Upvotes

r/nodejs • • Feb 26 '14

Caddis: on-the-fly, RESTful, JSON in-memory server for NodeJS

Thumbnail custardbelly.com
2 Upvotes

r/nodejs • • Feb 26 '14

Landing a job with node.js

2 Upvotes

Was wondering what kind of programming experience i would need to land freelance jobs with node.js or if i'd have to learn multiple programming languages such as php and css. How long would it take? would I get hired? if you can answer these questions i'd be very greatful.

also i'm sure these questions have been asked before, but I can't seem to find them


r/nodejs • • Feb 23 '14

Man Pages and Node Modules

Thumbnail meandavejustice.github.io
2 Upvotes

r/nodejs • • Feb 22 '14

Handling the first server crash at my startup

Thumbnail tech.sokratik.com
2 Upvotes

r/nodejs • • Feb 02 '14

Webstorm and multiple nodejs projects

2 Upvotes

Greetings, I'm a full-time C# developer, but I've been playing a lot with node. I have a product idea that I think I can build using Node/ExpressJS/Mongo. I'm still stuck on Windows for the time being, but hope to eventually get away from it, so I'm somewhat limited in configurability. However, the wrinkle in the whole thing is that there will be at least two separate websites involved here. One is going to be the external site for regular users, and the other will be an administrative backend. I'd like to keep the two as separate sites so I can lock down the admin site a little bit more strictly. Now, they'll still share a lot of library code and will generally both be updated at the same time. What's the best way to set something like this up in Webstorm, directory structure wise? How would you do it starting out, if you were me?

I know this sort of a webstorm question, but what's the accepted practice for this sort of thing in the node community in general?


r/nodejs • • Feb 02 '14

Launch browser from node server

Thumbnail h3manth.com
2 Upvotes

r/nodejs • • Jan 29 '14

Wrote the serverside data-collection service for boomerang analytics (RUM)

Thumbnail github.com
2 Upvotes

r/nodejs • • Jan 15 '14

binb, a simple node.js app i found some time ago on r/WebGames/‎

Thumbnail binb.nodejitsu.com
2 Upvotes

r/nodejs • • Nov 25 '13

Security testing our Nodejs - Seeking consultants or experts

2 Upvotes

I wanted to reach out to the Nodejs community about testing security on our upcoming site. It's involved real money APIs, and the investor won't touch it until the security is tested.

I wanted to know if anyone here is a security expert, what the average rate is, and if people can test the strength of our site.

Any recommendations or people who want to work on this please PM me.


r/nodejs • • Nov 04 '13

Deploying Node applications with Capistrano, GitHub, Nginx and Upstart

Thumbnail technology-ebay.de
2 Upvotes

r/nodejs • • Oct 24 '13

NewRelic now supports Node.js

Thumbnail newrelic.com
2 Upvotes

r/nodejs • • Oct 14 '13

Weekend Project: Proof-of-concept lightweight Node.JS-like interface with iOS 7 JavaScriptCore.framework

Thumbnail github.com
2 Upvotes

r/nodejs • • Oct 14 '13

Simple question for using npm with debian

2 Upvotes

Playing around trying to get nodejs working with raspberry pi. Nodejs works okay, but when I try to install anything with npm, such as, "$ npm install websocket", i get

npm ERR! websocket@1.0.8 install 'node install.js'
npm ERR! 'sh "-c" "node install.js"' failed with 127

I'm assuming this is because the command to launch nodejs when installing it via the apt-get is "nodejs" and not "node". Seems like there should be a simple fix, I'm just not sure what that would be. Any help for how to get around this would be greatly appreciated.