Sourcevoid Docs

Everything you need to get started with Sourcevoid, pick your favorite language and let's get started!

Search results for "{{ search.query }}"

No results found for "{{search.query}}". 
View All Results

Build Nodejs Apps

Sourcevoid supports Nodejs out of the box, in combination with Sourcevoid's integrated Mongodb hosting solution it's
the perfect platform for Nodejs projects.


Building a REST API with Nodejs and getting it up and running on Sourcevoid is easy. Sourcevoid's flexible build system
and platform architecture makes it so that we support any Nodejs framework that you can run on your local computer.

Nodejs Hello World

Here is a simple "Hello World" program using the Express framework:

var express = require('express');
var app = express();

app.get('/', function (req, res) {
  res.send('Hello World!');

app.listen(3000, function () {
  console.log('Example app listening on port 3000!');

The easiest way to deploy a Nodejs server app is to use npm's standard application package layout (as defined by
the npm documentation)
and the system will autodetect and generate the required Nodejs system configuration. To do this simply keep your
packages.json file at the top level of your deployed source code and either put your server's main function in a file
called server.js or specify the server script using the npm settings, for example like this
"scripts": {"start": "node bin/server.js"}. You can also use your own sourcevoid.yaml config file where you
specify runtime: nodejs and your other prefered settings, you can see an example of a Nodejs server config further
down on this page. To deploy client side apps built using Nodejs please see the static

Nodejs server side frameworks

Below are some Nodejs server side frameworks that you can try out. This is not a complete list as Sourcevoid support any
Nodejs frameworks or programs that you can run locally. We simply provide these links as a starter point if you are new
to the Nodejs platform.

Nodejs auto detection

Sourcevoid lets you choose if you want the system to implicitly detect and generate your Sourcevoid configuration based
on your source code's structure or if you want to explicitly define it using our sourcevoid.yaml config file.
When no config file is found in the environments specified source code root the system will try to auto detect a
runtime. Nodejs is detected by the presence of a package.json file, when no sourcevoid.yaml file is present the
default Nodejs server config file as shown below is used. If you want to change the commands being run by the build
pipeline or change the startup command just add a file called sourcevoid.yaml with your prefered settings and the
system will pick up the changes on future deployments.

Default Nodejs server config

runtime: nodejs
version: latest

- npm install

start: npm start

For more details about the sourcevoid.yaml config file please see the structure section.

Nodejs samples on Github

Check out more Nodejs samples on our Github org.

Getting started tutorials

Check out more Nodejs getting started tutorials on Github: