I found interfax in the npm. But not sure is it that I need. Can someone help me to find a right way for sending faxes using node+express?
Asked
Active
Viewed 1,182 times
1
-
The interfax sounds like the way to go – Priidik Vaikla Dec 30 '17 at 21:34
-
This seems quite opinion-based. Right way to send basically just means using a service of some sort; interfax is one of those. No-one can really definitively give you the correct answer. – Matt Fletcher Dec 30 '17 at 22:17
1 Answers
3
If you will take a look at source code of the interfax library, you can see that this library is using native node.js module https
. You can read more about it here.
So you do not need express
at all. Just go ahead with the documentation in the readme file.
But if you want to send fax after some endpoint call, you can do something like this:
const express = require('express');
const app = express();
const InterFAX = require('interfax');
// Initialize using parameters
const interfax = new InterFAX({
username: '...',
password: '...'
});
app.get('/sendFax', (req, res) => {
// Send test file
interfax.outbound.deliver({
faxNumber: '+11111111112',
file: 'folder/fax.txt'
})
.then(fax => {
res.send('Fax sended');
})
.catch(error => {
res.send('Error: ', error);
});
});
app.listen(3000);

Yevhenii Herasymchuk
- 2,047
- 15
- 20