-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest-api.js
35 lines (28 loc) · 1007 Bytes
/
test-api.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Author: Jean-Marie Thewes
//Modules:
const almaPrint = require("./alma-print.js");
const log = require("./log.js");
//Global variables:
const configFileName = "config/config.json";
//Environment vars:
process.env.configFileName = configFileName;
//Functions:
async function getPrinters(){
return await almaPrint.getPrinter();
}//------------------------------------------------------------------------------------------
function report(Message){
console.log("Testing API access module:");
console.log("Outputting list of API defined Printers:");
console.log(Message);
}//------------------------------------------------------------------------------------------
function error(Message){
console.log("Testing API access module:");
console.log("Error encountered:");
console.log(Message);
}//------------------------------------------------------------------------------------------
//Main:
Promise.resolve()
.then(log.init)
.then(getPrinters)
.then(report)
.catch(error)