Skip to content

Commit f85d34d

Browse files
committed
Initial commit
0 parents  commit f85d34d

File tree

344 files changed

+53499
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

344 files changed

+53499
-0
lines changed

index.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
"use strict";
2+
const express = require("express");
3+
const path = require("path");
4+
5+
const { exec } = require("child_process");
6+
7+
const app = express();
8+
9+
const PORT = process.env.PORT || 3000;
10+
11+
const pagesDir = path.join(__dirname, "public/");
12+
13+
app.use(
14+
express.static(path.join(__dirname, "public")),
15+
express.urlencoded({ extended: true })
16+
);
17+
18+
app.get("/", (_, res) => {
19+
return res.sendFile(path.join(pagesDir, "form.html"));
20+
});
21+
22+
app.post("/api", (req, res) => {
23+
const ipAddress = req.body.ipaddress;
24+
25+
exec(`ping -c 1 ${ipAddress}`, (err, stdout, stderr) => {
26+
if (err) {
27+
return res.send(stderr);
28+
} else {
29+
return res.send(stdout);
30+
}
31+
});
32+
});
33+
34+
app.listen(3000);
35+
console.log(`Listening on port ${PORT}`);

key.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Congratulations, you have found the key!

node_modules/.bin/mime

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/.yarn-integrity

Lines changed: 70 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/accepts/HISTORY.md

Lines changed: 236 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/accepts/LICENSE

Lines changed: 23 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)