mirror of
https://github.com/NebulaServices/Nebula.git
synced 2025-05-13 03:50:02 -04:00
some backend updates
This commit is contained in:
parent
e0805868a6
commit
c9a02c2351
5 changed files with 25 additions and 21 deletions
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"marketplace_enabled": false,
|
||||
"marketplace_enabled": true,
|
||||
"marketplace_psk": "CHANGE_THIS_THIS_IS_INSECURE",
|
||||
"marketplace_level": "1"
|
||||
}
|
Binary file not shown.
Before Width: | Height: | Size: 206 KiB |
|
@ -1,19 +0,0 @@
|
|||
:root {
|
||||
--background-primary: rgba(0, 0, 0, 0);
|
||||
--background-lighter: #04ff00;
|
||||
--navbar-color: #ffffff;
|
||||
--navbar-height: 60px;
|
||||
--navbar-text-color: #ff7300;
|
||||
--navbar-link-color: #16dcff;
|
||||
--navbar-link-hover-color: gray;
|
||||
--navbar-font: "Roboto";
|
||||
--input-text-color: #e0def4;
|
||||
--input-placeholder-color: white;
|
||||
--input-background-color: #ffb9d5;
|
||||
--input-border-color: #eb6f92;
|
||||
--input-border-size: 1.3px;
|
||||
--navbar-logo-filter: none;
|
||||
--dropdown-option-hover-color: #a891f4;
|
||||
--tab-color: var(--black);
|
||||
--border-color: #ff009d;
|
||||
}
|
23
server.js
23
server.js
|
@ -30,6 +30,7 @@ function auth_psk(req, res, next) {
|
|||
|
||||
if (req.headers.psk !== config.marketplace_psk) {
|
||||
let err = "Bad PSK!";
|
||||
console.log("Bad psk");
|
||||
return next(err);
|
||||
}
|
||||
|
||||
|
@ -117,6 +118,8 @@ const catalog_assets = sequelize.define("catalog_assets", {
|
|||
},
|
||||
});
|
||||
|
||||
app.use(express.json());
|
||||
|
||||
app.get("/api", function (request, reply) {
|
||||
reply.send({ hello: "world" });
|
||||
});
|
||||
|
@ -270,6 +273,26 @@ app.post(
|
|||
}
|
||||
);
|
||||
|
||||
// This API is responsible for creating packages in the database.
|
||||
// PSK authentication required.
|
||||
app.post("/api/create-package", auth_psk, async function (req, res) {
|
||||
console.log(req.body);
|
||||
await catalog_assets.create({
|
||||
package_name: req.body.uuid,
|
||||
title: req.body.title,
|
||||
image: req.body.image_path,
|
||||
author: req.body.author,
|
||||
version: req.body.version,
|
||||
description: req.body.description,
|
||||
tags: ["Hacking", "Animated", "Funny"],
|
||||
payload: req.body.payload,
|
||||
background_video: req.body.background_video,
|
||||
background_image: req.body.background_image_path,
|
||||
type: req.body.type,
|
||||
});
|
||||
res.send({ hello: "world" });
|
||||
});
|
||||
|
||||
app.use("/images/", express.static("./database_assets/image"));
|
||||
app.use("/videos/", express.static("./database_assets/video"));
|
||||
app.use("/styles/", express.static("./database_assets/styles"));
|
||||
|
|
|
@ -10,7 +10,7 @@ const form = new FormData();
|
|||
form.set("file", await fileFromPath("asgard.png"));
|
||||
|
||||
console.log(config.marketplace_psk);
|
||||
|
||||
console.log(form);
|
||||
await fetch("http://localhost:8080/api/upload-image", {
|
||||
headers: {
|
||||
PSK: config.marketplace_psk,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue