varius official platform source code.
Revision | 61fb1ea15b7f4cba9ec872756bb4bdfb09a8b51c (tree) |
---|---|
Time | 2023-04-02 17:55:24 |
Author | NknightA <n.knight.pc0627@gmai...> |
Commiter | NknightA |
udpate
@@ -0,0 +1,9 @@ | ||
1 | +"use strict"; | |
2 | +Object.defineProperty(exports, "__esModule", { value: true }); | |
3 | +var background_module_sass_1 = require("./background.module.sass"); | |
4 | +function Background() { | |
5 | + return (<div className={background_module_sass_1.default.Main}> | |
6 | + <h1>Awesome METAVERSE...</h1> | |
7 | + </div>); | |
8 | +} | |
9 | +exports.default = Background; |
@@ -0,0 +1,21 @@ | ||
1 | +"use strict"; | |
2 | +Object.defineProperty(exports, "__esModule", { value: true }); | |
3 | +exports.Box = void 0; | |
4 | +var Box = function (_a) { | |
5 | + var children = _a.children, w = _a.w, display = _a.display, bgColor = _a.bgColor, h = _a.h, m = _a.m, p = _a.p, jc = _a.jc, ai = _a.ai, textSize = _a.textSize; | |
6 | + return (<div style={{ | |
7 | + backgroundColor: bgColor, | |
8 | + color: '#000', | |
9 | + height: h, | |
10 | + width: w, | |
11 | + display: display, | |
12 | + justifyContent: jc, | |
13 | + alignItems: ai, | |
14 | + padding: p, | |
15 | + margin: m, | |
16 | + fontSize: textSize | |
17 | + }}> | |
18 | + {children} | |
19 | + </div>); | |
20 | +}; | |
21 | +exports.Box = Box; |
@@ -0,0 +1,14 @@ | ||
1 | +"use strict"; | |
2 | +Object.defineProperty(exports, "__esModule", { value: true }); | |
3 | +exports.devmode = void 0; | |
4 | +var devmode = function () { | |
5 | + var dev = 'dev'; | |
6 | + var pud = 'pud'; | |
7 | + if (process.env.NODE_ENV === "development") { | |
8 | + return dev; | |
9 | + } | |
10 | + else { | |
11 | + return pud; | |
12 | + } | |
13 | +}; | |
14 | +exports.devmode = devmode; |
@@ -0,0 +1 @@ | ||
1 | +console.log("Hello World!"); |
@@ -0,0 +1,8 @@ | ||
1 | +"use strict"; | |
2 | +Object.defineProperty(exports, "__esModule", { value: true }); | |
3 | +require("@/styles/globals.css"); | |
4 | +function App(_a) { | |
5 | + var Component = _a.Component, pageProps = _a.pageProps; | |
6 | + return <Component {...pageProps}/>; | |
7 | +} | |
8 | +exports.default = App; |
@@ -0,0 +1,21 @@ | ||
1 | +"use strict"; | |
2 | +Object.defineProperty(exports, "__esModule", { value: true }); | |
3 | +var document_1 = require("next/document"); | |
4 | +function Document() { | |
5 | + return (<document_1.Html lang="en"> | |
6 | + <document_1.Head> | |
7 | + <title>a</title> | |
8 | + <meta name="description" content="Generated by create next app"/> | |
9 | + <meta name="viewport" content="width=device-width, initial-scale=1"/> | |
10 | + <link rel="icon" href="/favicon.ico"/> | |
11 | + </document_1.Head> | |
12 | + <body> | |
13 | + <header> | |
14 | + <h1>V</h1> | |
15 | + </header> | |
16 | + <document_1.Main /> | |
17 | + <document_1.NextScript /> | |
18 | + </body> | |
19 | + </document_1.Html>); | |
20 | +} | |
21 | +exports.default = Document; |
@@ -0,0 +1,78 @@ | ||
1 | +"use strict"; | |
2 | +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | |
3 | + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | |
4 | + return new (P || (P = Promise))(function (resolve, reject) { | |
5 | + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | |
6 | + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | |
7 | + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | |
8 | + step((generator = generator.apply(thisArg, _arguments || [])).next()); | |
9 | + }); | |
10 | +}; | |
11 | +var __generator = (this && this.__generator) || function (thisArg, body) { | |
12 | + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; | |
13 | + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; | |
14 | + function verb(n) { return function (v) { return step([n, v]); }; } | |
15 | + function step(op) { | |
16 | + if (f) throw new TypeError("Generator is already executing."); | |
17 | + while (g && (g = 0, op[0] && (_ = 0)), _) try { | |
18 | + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; | |
19 | + if (y = 0, t) op = [op[0] & 2, t.value]; | |
20 | + switch (op[0]) { | |
21 | + case 0: case 1: t = op; break; | |
22 | + case 4: _.label++; return { value: op[1], done: false }; | |
23 | + case 5: _.label++; y = op[1]; op = [0]; continue; | |
24 | + case 7: op = _.ops.pop(); _.trys.pop(); continue; | |
25 | + default: | |
26 | + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } | |
27 | + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } | |
28 | + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } | |
29 | + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } | |
30 | + if (t[2]) _.ops.pop(); | |
31 | + _.trys.pop(); continue; | |
32 | + } | |
33 | + op = body.call(thisArg, _); | |
34 | + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } | |
35 | + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; | |
36 | + } | |
37 | +}; | |
38 | +Object.defineProperty(exports, "__esModule", { value: true }); | |
39 | +var react_1 = require("react"); | |
40 | +function CreateAccount() { | |
41 | + var _this = this; | |
42 | + var _a = (0, react_1.useState)(""), email = _a[0], setEmail = _a[1]; | |
43 | + var _b = (0, react_1.useState)(""), password = _b[0], setPassword = _b[1]; | |
44 | + var handleSubmit = function () { return __awaiter(_this, void 0, void 0, function () { | |
45 | + var response, data; | |
46 | + return __generator(this, function (_a) { | |
47 | + switch (_a.label) { | |
48 | + case 0: return [4 /*yield*/, fetch("/api/account", { | |
49 | + method: "POST", | |
50 | + headers: { | |
51 | + "Content-Type": "application/json", | |
52 | + }, | |
53 | + body: JSON.stringify({ email: email, password: password }), | |
54 | + })]; | |
55 | + case 1: | |
56 | + response = _a.sent(); | |
57 | + return [4 /*yield*/, response.json()]; | |
58 | + case 2: | |
59 | + data = _a.sent(); | |
60 | + console.log(data); | |
61 | + return [2 /*return*/]; | |
62 | + } | |
63 | + }); | |
64 | + }); }; | |
65 | + return (<div> | |
66 | + <h1>Create Account</h1>, | |
67 | + <label htmlFor="email">Email | |
68 | + <form onSubmit={handleSubmit}> | |
69 | + <input type="email" value={email} onChange={function (e) { return setEmail(e.target.value); }}/> | |
70 | + </form> | |
71 | + <form onSubmit={handleSubmit}> | |
72 | + <input type="password" value={password} onChange={function (e) { return setPassword(e.target.value); }}/> | |
73 | + </form> | |
74 | + <button type="submit">Create Account</button> | |
75 | + </label> | |
76 | + </div>); | |
77 | +} | |
78 | +exports.default = CreateAccount; |
@@ -0,0 +1,6 @@ | ||
1 | +"use strict"; | |
2 | +Object.defineProperty(exports, "__esModule", { value: true }); | |
3 | +function handler(req, res) { | |
4 | + res.status(200).json({ name: 'John Doe' }); | |
5 | +} | |
6 | +exports.default = handler; |
@@ -0,0 +1,15 @@ | ||
1 | +"use strict"; | |
2 | +Object.defineProperty(exports, "__esModule", { value: true }); | |
3 | +function Home() { | |
4 | + var Devmode = function () { | |
5 | + if (process.env.NODE_ENV === "development") { | |
6 | + return (<p> development mode </p>); | |
7 | + } | |
8 | + else { | |
9 | + return (<p> development mode </p>); | |
10 | + } | |
11 | + }; | |
12 | + return (<div> | |
13 | + </div>); | |
14 | +} | |
15 | +exports.default = Home; |
@@ -0,0 +1,70 @@ | ||
1 | +"use strict"; | |
2 | +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | |
3 | + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | |
4 | + return new (P || (P = Promise))(function (resolve, reject) { | |
5 | + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | |
6 | + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | |
7 | + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | |
8 | + step((generator = generator.apply(thisArg, _arguments || [])).next()); | |
9 | + }); | |
10 | +}; | |
11 | +var __generator = (this && this.__generator) || function (thisArg, body) { | |
12 | + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; | |
13 | + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; | |
14 | + function verb(n) { return function (v) { return step([n, v]); }; } | |
15 | + function step(op) { | |
16 | + if (f) throw new TypeError("Generator is already executing."); | |
17 | + while (g && (g = 0, op[0] && (_ = 0)), _) try { | |
18 | + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; | |
19 | + if (y = 0, t) op = [op[0] & 2, t.value]; | |
20 | + switch (op[0]) { | |
21 | + case 0: case 1: t = op; break; | |
22 | + case 4: _.label++; return { value: op[1], done: false }; | |
23 | + case 5: _.label++; y = op[1]; op = [0]; continue; | |
24 | + case 7: op = _.ops.pop(); _.trys.pop(); continue; | |
25 | + default: | |
26 | + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } | |
27 | + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } | |
28 | + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } | |
29 | + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } | |
30 | + if (t[2]) _.ops.pop(); | |
31 | + _.trys.pop(); continue; | |
32 | + } | |
33 | + op = body.call(thisArg, _); | |
34 | + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } | |
35 | + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; | |
36 | + } | |
37 | +}; | |
38 | +Object.defineProperty(exports, "__esModule", { value: true }); | |
39 | +var express_1 = require("express"); | |
40 | +var next_1 = require("next"); | |
41 | +var dev = process.env.NODE_ENV === "production"; | |
42 | +var port = "https://variussoftware.com"; | |
43 | +var app = (0, next_1.default)({ dev: dev }); | |
44 | +var handle = app.getRequestHandler(); | |
45 | +(function () { return __awaiter(void 0, void 0, void 0, function () { | |
46 | + var server, e_1; | |
47 | + return __generator(this, function (_a) { | |
48 | + switch (_a.label) { | |
49 | + case 0: | |
50 | + _a.trys.push([0, 2, , 3]); | |
51 | + return [4 /*yield*/, app.prepare()]; | |
52 | + case 1: | |
53 | + _a.sent(); | |
54 | + server = (0, express_1.default)(); | |
55 | + server.all("*", function (req, res) { | |
56 | + return handle(req, res); | |
57 | + }); | |
58 | + server.listen(port, function () { | |
59 | + console.log("running https://variussoftware.com"); | |
60 | + //cgiExpress.execute(server); | |
61 | + }); | |
62 | + return [3 /*break*/, 3]; | |
63 | + case 2: | |
64 | + e_1 = _a.sent(); | |
65 | + console.error(e_1); | |
66 | + return [3 /*break*/, 3]; | |
67 | + case 3: return [2 /*return*/]; | |
68 | + } | |
69 | + }); | |
70 | +}); })(); |
@@ -0,0 +1,22 @@ | ||
1 | +"use strict"; | |
2 | +Object.defineProperty(exports, "__esModule", { value: true }); | |
3 | +var toolkit_1 = require("@reduxjs/toolkit"); | |
4 | +var react_1 = require("react"); | |
5 | +function countterReducer(_a) { | |
6 | + var _b = _a.state, state = _b === void 0 ? { value: 1 } : _b, action = _a.action; | |
7 | + switch (action.type) { | |
8 | + case "increment": | |
9 | + return state + 1; | |
10 | + case "decrement": | |
11 | + return state - 1; | |
12 | + default: | |
13 | + return state; | |
14 | + } | |
15 | +} | |
16 | +var storePal = (0, toolkit_1.createStore)(countterReducer); | |
17 | +function Returnstatus() { | |
18 | + return (<> | |
19 | + {storePal} | |
20 | + </>); | |
21 | +} | |
22 | +exports.default = Returnstatus; |
@@ -0,0 +1,88 @@ | ||
1 | +"use strict"; | |
2 | +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | |
3 | + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | |
4 | + return new (P || (P = Promise))(function (resolve, reject) { | |
5 | + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | |
6 | + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | |
7 | + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | |
8 | + step((generator = generator.apply(thisArg, _arguments || [])).next()); | |
9 | + }); | |
10 | +}; | |
11 | +var __generator = (this && this.__generator) || function (thisArg, body) { | |
12 | + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; | |
13 | + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; | |
14 | + function verb(n) { return function (v) { return step([n, v]); }; } | |
15 | + function step(op) { | |
16 | + if (f) throw new TypeError("Generator is already executing."); | |
17 | + while (g && (g = 0, op[0] && (_ = 0)), _) try { | |
18 | + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; | |
19 | + if (y = 0, t) op = [op[0] & 2, t.value]; | |
20 | + switch (op[0]) { | |
21 | + case 0: case 1: t = op; break; | |
22 | + case 4: _.label++; return { value: op[1], done: false }; | |
23 | + case 5: _.label++; y = op[1]; op = [0]; continue; | |
24 | + case 7: op = _.ops.pop(); _.trys.pop(); continue; | |
25 | + default: | |
26 | + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } | |
27 | + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } | |
28 | + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } | |
29 | + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } | |
30 | + if (t[2]) _.ops.pop(); | |
31 | + _.trys.pop(); continue; | |
32 | + } | |
33 | + op = body.call(thisArg, _); | |
34 | + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } | |
35 | + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; | |
36 | + } | |
37 | +}; | |
38 | +Object.defineProperty(exports, "__esModule", { value: true }); | |
39 | +exports.createUserPost = void 0; | |
40 | +var pg_1 = require("pg"); | |
41 | +var pool = new pg_1.Pool({ | |
42 | + user: 'dbuser', | |
43 | + host: 'localhost', | |
44 | + database: 'mydb', | |
45 | + password: 'secretpassword', | |
46 | + port: 5432, | |
47 | +}); | |
48 | +var createUserPost = function (_a) { | |
49 | + var req = _a.req, res = _a.res; | |
50 | + return __awaiter(void 0, void 0, void 0, function () { | |
51 | + var _b, name, email, client, queryText, values, rows, e_1; | |
52 | + return __generator(this, function (_c) { | |
53 | + switch (_c.label) { | |
54 | + case 0: | |
55 | + _b = req.body, name = _b.name, email = _b.email; | |
56 | + return [4 /*yield*/, pool.connect()]; | |
57 | + case 1: | |
58 | + client = _c.sent(); | |
59 | + _c.label = 2; | |
60 | + case 2: | |
61 | + _c.trys.push([2, 6, 8, 9]); | |
62 | + return [4 /*yield*/, client.query('BEGIN')]; | |
63 | + case 3: | |
64 | + _c.sent(); | |
65 | + queryText = 'INSERT INTO users(name, email) VALUES($1, $2) RETURNING *'; | |
66 | + values = [name, email]; | |
67 | + return [4 /*yield*/, client.query(queryText, values)]; | |
68 | + case 4: | |
69 | + rows = (_c.sent()).rows; | |
70 | + return [4 /*yield*/, client.query('COMMIT')]; | |
71 | + case 5: | |
72 | + _c.sent(); | |
73 | + return [2 /*return*/, res.status(201).send(rows[0])]; | |
74 | + case 6: | |
75 | + e_1 = _c.sent(); | |
76 | + return [4 /*yield*/, client.query('ROLLBACK')]; | |
77 | + case 7: | |
78 | + _c.sent(); | |
79 | + throw e_1; | |
80 | + case 8: | |
81 | + client.release(); | |
82 | + return [7 /*endfinally*/]; | |
83 | + case 9: return [2 /*return*/]; | |
84 | + } | |
85 | + }); | |
86 | + }); | |
87 | +}; | |
88 | +exports.createUserPost = createUserPost; |
@@ -0,0 +1,7 @@ | ||
1 | +{ | |
2 | + "watch": [ | |
3 | + "./src/server" | |
4 | + ], | |
5 | + "ext": "ts", | |
6 | + "exec": "ts-node ./src/server/server.ts" | |
7 | +} | |
\ No newline at end of file |