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
025d42c5
Commit
025d42c5
authored
May 27, 2019
by
nagayama15
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Serve static files
parent
67780e69
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
2 deletions
+22
-2
index.ts
server/src/index.ts
+8
-2
index.html
server/static/index.html
+14
-0
add.wasm
server/wasm/add.wasm
+0
-0
No files found.
server/src/index.ts
View file @
025d42c5
import
*
as
fs
from
"fs"
;
import
*
as
express
from
"express"
;
const
port
=
3000
;
...
...
@@ -8,6 +9,11 @@ const server = app.listen(port, () => {
console
.
log
(
`server listening at port
${
port
}
`
);
});
app
.
get
(
"/"
,
(
req
:
express
.
Request
,
res
:
express
.
Response
)
=>
{
res
.
send
(
"Hello, world!"
);
app
.
get
(
"/wasm/add.wasm"
,
(
req
:
express
.
Request
,
res
:
express
.
Response
)
=>
{
const
binary
=
fs
.
readFileSync
(
`
${
__dirname
}
/../wasm/add.wasm`
);
res
.
writeHead
(
200
,
{
contentType
:
"application/wasm"
});
res
.
end
(
binary
);
});
app
.
use
(
express
.
static
(
`
${
__dirname
}
/../static`
));
server/static/index.html
0 → 100644
View file @
025d42c5
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<meta
charset=
"utf-8"
/>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
/>
<title>
Watermark Server
</title>
</head>
<body>
<h1>
Watermark Server
</h1>
<script>
console
.
log
(
"Hello, world!"
);
</script>
</body>
</html>
server/wasm/add.wasm
0 → 100644
View file @
025d42c5
File added
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