Skip to content

Commit

Permalink
chore: API landing page favicon (#430)
Browse files Browse the repository at this point in the history
* feat: api landing page favico, misc fixes

* feat: typo

* feat: rm API Test button

* fix: serve favicon static asset

---------

Co-authored-by: michael1011 <[email protected]>
  • Loading branch information
kilrau and michael1011 authored Nov 7, 2023
1 parent 3895c01 commit e4671c8
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
5 changes: 4 additions & 1 deletion lib/api/Api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@ class Api {

private registerRoutes = (controller: Controller) => {
// Static files
this.app.route('/').get(controller.landingPage);
['/', '/index.html'].forEach((path) => {
this.app.route(path).get(controller.serveFile('index.html'));
});
this.app.route('/favicon.ico').get(controller.serveFile('favicon.ico'));

// GET requests
this.app.route('/version').get(controller.version);
Expand Down
6 changes: 4 additions & 2 deletions lib/api/Controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,10 @@ class Controller {
};

// Static files
public landingPage = (_: Request, res: Response): void => {
res.sendFile(path.join(__dirname, 'static', 'api.html'));
public serveFile = (fileName: string) => {
return (_: Request, res: Response): void => {
res.sendFile(path.join(__dirname, 'static', fileName));
};
};

// GET requests
Expand Down
Binary file added lib/api/static/favicon.ico
Binary file not shown.
6 changes: 3 additions & 3 deletions lib/api/static/api.html → lib/api/static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<head>
<meta charset="UTF-8">
<title>Boltz API</title>
<link rel="icon" type="image/ico" href="favicon.ico">
<style>
html,body {
height: 100%;
Expand Down Expand Up @@ -41,10 +42,9 @@
<body>
<div>
<svg width="46.626mm" height="12.965mm" version="1.1" viewBox="0 0 46.626 12.965" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><defs><linearGradient id="paint0_linear" x2="0" y2="49" gradientUnits="userSpaceOnUse"><stop stop-color="#FFE96D" offset="0"/><stop stop-color="#E1C218" offset="1"/></linearGradient><linearGradient id="paint0_linear-3" x1="-3" x2="-3" y1="-11" y2="56" gradientUnits="userSpaceOnUse"><stop stop-color="#FFE96D" offset="0"/><stop stop-color="#E1C218" offset="1"/></linearGradient></defs><g transform="translate(-69.488 -50.153)"><g transform="matrix(.26458 0 0 .26458 69.488 50.153)" style="fill:none"><path d="m14.462 28.768-0.0035 0.0072h-12.787c-0.4776 0-0.8756-0.1467-1.194-0.4401s-0.4776-0.6619-0.4776-1.1055c0-0.4723 0.20262-0.9589 0.60786-1.4598l20.342-24.837c0.3763-0.48659 0.7924-0.77997 1.2482-0.88015 0.4559-0.10018 0.8648-0.057246 1.2266 0.1288 0.3618 0.18605 0.6151 0.49016 0.7598 0.91235 0.1448 0.42218 0.1086 0.92666-0.1085 1.5134l-6.643 17.625h1.1057l0.0035-0.0072h12.787c0.4776 0 0.8756 0.1467 1.194 0.4401s0.4776 0.6619 0.4776 1.1055c0 0.4723-0.2026 0.9589-0.6079 1.4598l-20.342 24.837c-0.3763 0.4865-0.7924 0.7799-1.2482 0.8801-0.4559 0.1002-0.86479 0.0573-1.2266-0.1288-0.36182-0.186-0.61509-0.4902-0.75982-0.9123-0.14473-0.4222-0.10855-0.9267 0.10854-1.5135l6.643-17.624z" clip-rule="evenodd" fill="url(#paint0_linear)" fill-rule="evenodd" style="fill:url(#paint0_linear)"/></g><g transform="matrix(.26458 0 0 .26458 81.643 50.938)" style="fill:none"><path d="m0.92 42h19.488c7.672 0 12.488-4.144 12.488-11.312 0-5.152-2.072-7.952-5.264-9.464v-0.224c1.96-1.4 3.808-3.752 3.808-8.008 0-6.44-4.76-10.192-11.76-10.192h-18.76zm8.736-24.08v-7.392h8.736c2.968 0 4.144 1.568 4.144 3.696s-1.176 3.696-4.144 3.696zm0 16.296v-8.68h9.296c3.808 0 4.984 2.352 4.984 4.312 0 2.352-1.232 4.368-4.984 4.368zm40.657 8.288c9.52 0 14.616-6.384 14.616-15.12 0-8.792-5.208-15.176-14.616-15.176s-14.616 6.384-14.616 15.176 5.096 15.12 14.616 15.12zm0-7.56c-3.528 0-5.824-2.24-5.824-7.56 0-5.264 2.24-7.616 5.824-7.616s5.824 2.296 5.824 7.616-2.24 7.56-5.824 7.56zm18.831 7.056h8.624v-41.44h-8.624zm26.552 0.504c2.744 0 5.0404-0.504 5.9364-0.84v-7.168h-0.56c-0.896 0.336-1.8484 0.504-2.8004 0.504-2.576 0-3.752-1.176-3.752-3.92v-11.032h7.0004v-7.336h-7.0004v-7.672h-0.56l-7.672 1.568v6.104h-5.152v7.336h4.76v13.104c0 5.32 3.024 9.352 9.8 9.352zm10.397-0.504h24.192v-7.336h-13.552v-0.224l13.44-14.448v-7.28h-24.024v7.336h13.44v0.224l-13.496 14.504z" fill="url(#paint0_linear)" style="fill:url(#paint0_linear-3)"/></g></g></svg>
<h1>Privacy First, Non-Custodial Bitcoin Exchange</h1>
<p>Can't be evil. You are in control of your money. Always.</p>
<h1>API Endpoint</h1>
<a class="btn" target="_blank" href="https://docs.boltz.exchange/v/api/">API Docs</a>
<a class="btn" target="_blank" href="https://boltz.exchange">Web App</a>
<a class="btn" target="_blank" href="https://docs.boltz.exchange">API Docs</a>
</div>
</body>
</html>

0 comments on commit e4671c8

Please sign in to comment.