mirror of
https://github.com/openziti/zrok.git
synced 2025-06-21 18:21:34 +02:00
lint (#893)
This commit is contained in:
parent
56b8d1e92c
commit
8ca598ab3a
@ -10,33 +10,29 @@ import {
|
||||
ShareRequest
|
||||
} from "@openziti/zrok";
|
||||
|
||||
const program = new Command();
|
||||
|
||||
program
|
||||
.command("http-server")
|
||||
.version("1.0.0")
|
||||
.description("A simple HTTP server example, sharing directly to a zrok share")
|
||||
.action(async () => {
|
||||
let root = loadRoot();
|
||||
await init(root)
|
||||
.catch((err: Error) => {
|
||||
console.log(err);
|
||||
return process.exit(1);
|
||||
});
|
||||
let shr = await createShare(root, new ShareRequest(PUBLIC_SHARE_MODE, PROXY_BACKEND_MODE, "http-server"));
|
||||
|
||||
let app = express(shr);
|
||||
app.get("/", (r: Request, res: any) => {
|
||||
res.write("hello, world!\n");
|
||||
res.end();
|
||||
});
|
||||
app.listen(undefined, () => {
|
||||
console.log("listening at '" + shr.frontendEndpoints + "'");
|
||||
const httpServer = async () => {
|
||||
let root = loadRoot();
|
||||
await init(root)
|
||||
.catch((err: Error) => {
|
||||
console.log(err);
|
||||
return process.exit(1);
|
||||
});
|
||||
let shr = await createShare(root, new ShareRequest(PUBLIC_SHARE_MODE, PROXY_BACKEND_MODE, "http-server"));
|
||||
|
||||
process.on("SIGINT", async () => {
|
||||
deleteShare(root, shr);
|
||||
});
|
||||
let app = express(shr);
|
||||
app.get("/", (r: Request, res: any) => {
|
||||
res.write("hello, world!\n");
|
||||
res.end();
|
||||
});
|
||||
app.listen(undefined, () => {
|
||||
console.log("listening at '" + shr.frontendEndpoints + "'");
|
||||
});
|
||||
|
||||
process.on("SIGINT", async () => {
|
||||
deleteShare(root, shr);
|
||||
});
|
||||
}
|
||||
|
||||
const program = new Command();
|
||||
program.command("http-server").description("A simple HTTP server example, sharing directly to a zrok share").action(httpServer);
|
||||
program.parse(process.argv);
|
@ -13,8 +13,6 @@ import {
|
||||
} from "@openziti/zrok";
|
||||
import readlineSync = require('readline-sync');
|
||||
|
||||
const program = new Command();
|
||||
|
||||
const copyto = async () => {
|
||||
let text = readlineSync.question("enter some text: ");
|
||||
let root = loadRoot();
|
||||
@ -36,5 +34,6 @@ const copyto = async () => {
|
||||
});
|
||||
}
|
||||
|
||||
const program = new Command();
|
||||
program.command("copyto").version("1.0.0").description("serve a copy buffer").action(copyto);
|
||||
program.parse(process.argv);
|
Loading…
x
Reference in New Issue
Block a user