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