add favicon and OpenGraph image
This commit is contained in:
parent
67aa1be4a0
commit
2b07401d28
BIN
favicon.ico
Normal file
BIN
favicon.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 162 KiB |
|
@ -7,8 +7,9 @@
|
|||
<meta property="og:title" content="Tech Workers' Syndicate" />
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:url" content="https://techwork.zone/">
|
||||
<meta property="og:image" content="/pfp.png" />
|
||||
<meta property="og:description"
|
||||
content="Matrix space: matrix.to/#/#tws:matrix.org; blog.techwork.zone; Mastodon: @syndicate@tams.tech; Bluesky: @techwork.zone; Source code: git.techwork.zone" />
|
||||
content="Chat: matrix.to/#/#tws:matrix.org; blog.techwork.zone; Mastodon: @syndicate@tams.tech; BlueSky: @techwork.zone; Source code: git.techwork.zone" />
|
||||
<title>Tech Workers' Syndicate</title>
|
||||
<style>
|
||||
html,
|
||||
|
|
14
index.js
14
index.js
|
@ -3,8 +3,20 @@ const { Server } = require('http')
|
|||
|
||||
async function main() {
|
||||
const webPage = await readFile('index.html', { encoding: 'utf-8' })
|
||||
const pfp = await readFile('pfp.png')
|
||||
const favicon = await readFile('favicon.ico')
|
||||
const server = new Server(
|
||||
(_, res) => res.writeHead(200, {'Content-Type': 'text/html'}).end(webPage)
|
||||
(req, res) => {
|
||||
if (req.url === '/pfp.png')
|
||||
req.writeHead(200, { 'Content-Type': 'image/png' })
|
||||
.end(pfp)
|
||||
else if (req.url === '/favicon.ico')
|
||||
req.writeHead(200, { 'Content-Type': 'image/vnd.microsoft.icon' })
|
||||
.end(favicon)
|
||||
else
|
||||
res.writeHead(200, { 'Content-Type': 'text/html' })
|
||||
.end(webPage)
|
||||
}
|
||||
)
|
||||
|
||||
server.listen(1312, () => {
|
||||
|
|
Loading…
Reference in a new issue