Speed up development with full-stack environments for every branch.

Learn More

nodeWebService [Node.js and Hello World]

Forked from Hello World for Node.js.

21 Runs 57 Views 12 Copies

Web Service using nodejs

Saved

Saved

emarinizquierdo 1

emarinizquierdo
published 3 years ago

var express = require('express');

var app = express();

/* Services */
services = {};

services.root = function(req, res) {
  res.send("It is a node web service!");
};

services.dummy = function(req, res) {
  res.json({message: 'Hello World!'});
};

/* Router */
app.get('/', services.root);
app.get('/s/dummy', services.dummy);

// Start server
app.listen(80, function () {
  console.log('Express server listening');
});
Please login/signup to get access to the terminal.

Your session has timed out.

Dismiss (the page may not function properly).