Facebook
From Paltry Hamster, 4 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 154
  1. const express = require('express');
  2. const fs = require('fs');
  3.  
  4. const app = express();
  5.  
  6. const api = express.Router();
  7.  
  8. app.listen(3000, () => {
  9.     console.log("Server is up and running");
  10.  
  11. });
  12.  
  13.  
  14. app.get('/hydra', (req, res) => {
  15.  
  16.     fs.readFile('./workflow.json', (err, json) => {
  17.         let obj = JSON.parse(json);
  18.         //res.json(obj);
  19.         res.send({ results: JSON.stringify(obj) });
  20.     });
  21. });