2022-12-01 18:30:34 +00:00
|
|
|
const express = require("express")
|
2022-12-15 15:33:17 +00:00
|
|
|
const body_parser = require("body-parser")
|
|
|
|
const base = require("base-64")
|
|
|
|
|
|
|
|
|
2022-12-01 18:30:34 +00:00
|
|
|
const app = express()
|
|
|
|
const PORT = 443
|
|
|
|
|
2022-12-15 15:33:17 +00:00
|
|
|
// express configuration
|
|
|
|
app.use(body_parser.urlencoded({
|
|
|
|
extended: true
|
|
|
|
}))
|
|
|
|
|
|
|
|
// Backend - Routes
|
|
|
|
|
|
|
|
// API - Routes
|
|
|
|
app.post("/client-fetch-keys", (req, res) => { // client sends here the keys
|
|
|
|
let keys = req.body.keys
|
|
|
|
console.log(base.decode(keys));
|
|
|
|
|
2022-12-01 18:30:34 +00:00
|
|
|
|
2022-12-15 15:33:17 +00:00
|
|
|
res.send("PIVOTER_OK\n");
|
2022-12-01 18:30:34 +00:00
|
|
|
})
|
|
|
|
|
|
|
|
app.listen(PORT)
|