Commit 6fe22cd6 authored by Navodya Pasqual's avatar Navodya Pasqual

Text file output

parent 8531d68a
Abstraction is a very important feature of OOPs that allows displaying only the important information and hiding the implementation details.
\ No newline at end of file
const express = require('express');
const router = express.Router();
const dialogflow = require('dialogflow');
fs = require('fs');
const config = require('../../config/digitalHuman/config');
const projectId = config.googleProjectID
......@@ -39,6 +39,14 @@ router.post('/textQuery', async (req, res) => {
console.log(` Query: ${result.queryText}`);
console.log(` Response: ${result.fulfillmentText}`);
fs.writeFile('output.txt', result.fulfillmentText , function (err,data) {
if (err) {
return console.log(err);
}
console.log(data);
});
res.send(result)
})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment