Skip to content

Writing Node.js in Coder #47

Open
Open
@brannondorsey

Description

@brannondorsey

I am a bit puzzled as to how writing Node.js inside of Coder works, where it is executed, and how it is debugged. When you use the fourth "Node" tab on any Coder app when will that server side code be run? If I am building an app in coder that relies on various Node.js processes (i.e. using the Twitter module to access a twitter stream and potentially push the content to the view) should that logic be written in the Node tab in the Coder GUI or inside the apps app.js file?

I am assuming that the request to each app's index page is handled via the exports.index_handler = function( req, res ) inside its respective app.js file. Does this mean that is where my custom Node code should go if I want it to be run whenever a user visits the page? What if I want it to be persistent?

Also, obviously Coder comes with Node because, well, Coder uses it. But I have found that I cannot access Node anywhere on my Pi except for inside coder-base. If I navigate to my home/ directory and try node somefile.js I get a command not found error. Is there a way to use the Node that comes with Coder on the Pi so that I don't have to install another copy?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions