Some Tests
This commit is contained in:
BIN
test/printserver/Briefpapier.pdf
Normal file
BIN
test/printserver/Briefpapier.pdf
Normal file
Binary file not shown.
52
test/printserver/index.js
Normal file
52
test/printserver/index.js
Normal file
@@ -0,0 +1,52 @@
|
||||
const find = require('local-devices')
|
||||
const {getPrinters, print } = require("unix-print");
|
||||
const ipp = require("ipp")
|
||||
|
||||
const express = require("express")
|
||||
const app = express()
|
||||
|
||||
|
||||
|
||||
|
||||
/*find().then(devices => {
|
||||
console.log(devices)
|
||||
})*/
|
||||
|
||||
|
||||
|
||||
|
||||
//let printers = await getPrinters()
|
||||
//console.log(printers)
|
||||
|
||||
app.get("/", async (req,res) => {
|
||||
console.log(req)
|
||||
|
||||
|
||||
res.send("ok")
|
||||
//res.json(await getPrinters())
|
||||
})
|
||||
|
||||
app.post("/printlabel", async (req,res) => {
|
||||
res.json(await getPrinters())
|
||||
})
|
||||
|
||||
app.get("/printdoc", async (req,res) => {
|
||||
res.json(await getPrinters())
|
||||
})
|
||||
|
||||
app.post("/printeralarm", (req,res) => {
|
||||
console.log(req)
|
||||
})
|
||||
|
||||
|
||||
|
||||
let options = [
|
||||
"-o media=a4",
|
||||
"-o sides=one-sided"
|
||||
]
|
||||
|
||||
|
||||
|
||||
//print("Briefpapier.pdf","EPSON_ET_15000_Series",options).then(console.log)
|
||||
|
||||
app.listen(3001)
|
||||
Reference in New Issue
Block a user