Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexplayrus2 authored Dec 12, 2022
1 parent 677d8a5 commit faf5781
Show file tree
Hide file tree
Showing 6 changed files with 1,246 additions and 0 deletions.
10 changes: 10 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<script
src="https://code.jquery.com/jquery-3.2.1.js"
integrity="sha256-DZAnKJ/6XZ9si04Hgrsxu/8s717jcIzLy3oi35EouyE="
crossorigin="anonymous"></script>

<script src="./api.js"></script>

<textarea id="executebox"></textarea>

<button onclick="executescript()">Execute</button>
40 changes: 40 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
const express = require('express');

const Database = require('easy-json-database')

const bodyParser = require("body-parser");

const db = new Database("./db.json", {
snapshots: {
enabled: true,
interval: 24 * 60 * 60 * 1000,
folder: './backups/'
}
});


const app = express();

app.use(bodyParser.urlencoded({ extended: false }));
app.use(bodyParser.json());
app.use(express.static(__dirname));
app.get('/', (req, res) => {
res.sendFile(__dirname + "/index.html")
});

app.get('/listen', (req, res) => {
res.send(db.get("executed"))
});

app.post('/executeapi',function(req, res){
db.set("executed", req.body.executedstring)
res.end("executed")
});

app.listen(3000, () => {
console.log('server started');
});

app.get('/connect', (req, res) => {
res.sendFile(__dirname + "/connect.lua")
});
Loading

0 comments on commit faf5781

Please sign in to comment.