Skip to content

Commit e1bbbdb

Browse files
committed
V 1.0.2
Fix: ctx.request.body.json();
1 parent 4ae5120 commit e1bbbdb

File tree

7 files changed

+6673
-6675
lines changed

7 files changed

+6673
-6675
lines changed

build-tools/binToTs.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ export async function initServer(wwwRoot: string): Promise<boolean> {
1010
const isExist = await exists(indexFile);
1111
if (isExist) {
1212
//Check for update
13-
const installedVersion = await getUiVersion(indexFile)
14-
13+
const installedVersion = await getUiVersion(indexFile);
14+
1515
if (installedVersion === version) {
1616
return true;
1717
}
1818

19-
console.log(`Updating UI from V${installedVersion} to V${version}`)
19+
console.log(`Updating UI from V${installedVersion} to V${version}`);
2020
//We need to remove old version
2121
await Deno.remove(indexFile);
2222
await Deno.remove(join(wwwRoot, "favicon.ico"));
@@ -66,7 +66,7 @@ export async function zipToTs(path: string, fileName: string) {
6666

6767
const binPath = join(path, `${fileName}.zip`);
6868
const uint = await Deno.readFile(binPath);
69-
69+
7070
let binary = "";
7171
const len = uint.length;
7272

deno.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"tasks": {
33
"start": "deno run -A mod.ts",
4-
"build": "deno run -A prepare-spa.ts"
4+
"build": "deno fmt && deno lint && deno run -A prepare-spa.ts"
55
},
66

77
"lint": {

mod.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,8 @@ router.post("/api/service", async (ctx) => {
7474
port: Number(ctx.request.url.searchParams.get("port")!),
7575
};
7676

77-
const req = ctx.request.body({ type: "json" });
78-
const reqObj = await req.value;
79-
const service = await actions(reqObj.serviceName, reqObj.action, payload);
77+
const req = await ctx.request.body.json();
78+
const service = await actions(req.serviceName, req.action, payload);
8079

8180
if (service !== undefined) {
8281
//Change the cache

prepare-spa.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@ await increaseUiVersion();
55
buildQuasar();
66
await spaToTypeScript();
77

8-
98
function buildQuasar() {
10-
const msg = "Please go to [./q-manui] and build the project [quasar build]."
9+
const msg = "Please go to [./q-manui] and build the project [quasar build].";
1110
alert(msg);
1211
}
1312

@@ -17,12 +16,12 @@ async function increaseUiVersion() {
1716
const packageFile = "./q-manui/package.json";
1817
let packageJson = await Deno.readTextFile(packageFile);
1918
const pkg = JSON.parse(packageJson);
20-
pkg.version = newVersion;
21-
pkg.description = `DenoMan ${newVersion}`
19+
pkg.version = newVersion;
20+
pkg.description = `DenoMan ${newVersion}`;
2221
packageJson = JSON.stringify(pkg, null, 2);
2322

2423
await Deno.writeTextFile(packageFile, packageJson);
25-
console.log("package.json file updated.")
24+
console.log("package.json file updated.");
2625
}
2726

2827
async function spaToTypeScript() {

q-manui/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "q-manui",
3-
"version": "1.0.1",
4-
"description": "DenoMan 1.0.1",
3+
"version": "1.0.2",
4+
"description": "DenoMan 1.0.2",
55
"productName": "q-manui",
66
"author": "Sameh Fakoua <s.fakoua@gmail.com>",
77
"private": true,

q-manui/src/layouts/MainLayout.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<q-layout view="lHh Lpr lFf">
33
<q-header elevated>
44
<q-toolbar>
5-
<q-toolbar-title> dennoman </q-toolbar-title>
5+
<q-toolbar-title> DenoMan </q-toolbar-title>
66

77
<div>v 0.1</div>
88
</q-toolbar>

wwwzip/ui.ts

Lines changed: 6659 additions & 6659 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)