Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
wasm-watermarker
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nagayama15
wasm-watermarker
Commits
982b1eb9
Commit
982b1eb9
authored
May 27, 2019
by
nagayama15
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change wasm directory
parent
4e9105a6
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
13 deletions
+10
-13
index.ts
server/src/index.ts
+9
-12
index.html
server/static/index.html
+1
-1
No files found.
server/src/index.ts
View file @
982b1eb9
...
@@ -12,9 +12,7 @@ const server = app.listen(port, () => {
...
@@ -12,9 +12,7 @@ const server = app.listen(port, () => {
console
.
log
(
`server listening at port
${
port
}
`
);
console
.
log
(
`server listening at port
${
port
}
`
);
});
});
app
.
get
(
app
.
get
(
"/add.wasm"
,
async
(
req
:
express
.
Request
,
res
:
express
.
Response
)
=>
{
"/wasm/add.wasm"
,
async
(
req
:
express
.
Request
,
res
:
express
.
Response
)
=>
{
const
path
=
`
${
__dirname
}
/../wasm/add.wasm`
;
const
path
=
`
${
__dirname
}
/../wasm/add.wasm`
;
const
watermark
=
req
.
query
.
v
||
""
;
const
watermark
=
req
.
query
.
v
||
""
;
...
@@ -24,7 +22,6 @@ app.get(
...
@@ -24,7 +22,6 @@ app.get(
const
process
=
childProcess
.
spawn
(
watermarker
,
[
path
,
watermark
,
"-"
]);
const
process
=
childProcess
.
spawn
(
watermarker
,
[
path
,
watermark
,
"-"
]);
process
.
stdout
.
pipe
(
res
);
process
.
stdout
.
pipe
(
res
);
res
.
on
(
"finish"
,
()
=>
console
.
timeEnd
(
"kyut"
));
res
.
on
(
"finish"
,
()
=>
console
.
timeEnd
(
"kyut"
));
}
});
);
app
.
use
(
express
.
static
(
`
${
__dirname
}
/../static`
));
app
.
use
(
express
.
static
(
`
${
__dirname
}
/../static`
));
server/static/index.html
View file @
982b1eb9
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
(
async
()
=>
{
(
async
()
=>
{
// Import wasm module
// Import wasm module
const
wasm
=
await
WebAssembly
.
instantiateStreaming
(
const
wasm
=
await
WebAssembly
.
instantiateStreaming
(
fetch
(
"
wasm/
add.wasm"
)
fetch
(
"add.wasm"
)
);
);
const
{
add2
,
add3
}
=
wasm
.
instance
.
exports
;
const
{
add2
,
add3
}
=
wasm
.
instance
.
exports
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment