⚡️⚡️⚡️ Self-hosted collaborative bookmark manager to collect, read, annotate, and fully preserve what matters, all in one place.
TypeScript bookmarkbookmark-managercollaborationnextjsreact-nativeread-it-laterself-hostedtypescript
Major preformance fix.
Danielb3e6e75f909e
diff --git a/api/server.js b/api/server.jsindex a31dc96d..568ea1c1 100644--- a/api/server.js+++ b/api/server.js@@ -5,6 +5,7 @@ const cors = require('cors');const config = require('../src/config.js');const getData = require('./modules/getData.js');const fs = require('fs');+const fetch = require('cross-fetch');const port = config.API.PORT;@@ -35,16 +36,27 @@ app.get('/pdfs/:id', async (req, res) => {app.post('/api', async (req, res) => {const pageToVisit = req.body.link;+ const id = req.body._id;+ const getTitle = async(url) => {+ let body;+ await fetch(url)+ .then(res => res.text())+ .then(text => body = text)+ // regular expression to parse contents of the <title> tag+ let match = body.match(/<title>([^<]*)<\/title>/);+ return match[1];+ }try {+ req.body.title = await getTitle(req.body.link);+ await insertDoc(req.body);++ res.send("DONE!");+const dataResult = await getData(pageToVisit, req.body._id);- req.body.title = dataResult;- insertDoc(req.body);} catch (err) {console.log(err);insertDoc(req.body);- } finally {- res.send('Posted!');}});diff --git a/src/styles/List.css b/src/styles/List.cssindex 570c6d6e..df7be41b 100644--- a/src/styles/List.css+++ b/src/styles/List.css@@ -37,7 +37,6 @@}.list-entity-content {- text-shadow: 0px 1px 3px #1f2c38;z-index: 0;margin-left: 70px;padding: 20px;diff --git a/src/styles/ViewArchived.css b/src/styles/ViewArchived.cssindex 45eebce2..05c2f7a9 100644--- a/src/styles/ViewArchived.css+++ b/src/styles/ViewArchived.css@@ -6,5 +6,5 @@.seperator {width: 100%;- color: white;+ color: #1f2c38;}\ No newline at end of filediff --git a/src/styles/index.css b/src/styles/index.cssindex bbf2feab..b44e7440 100644--- a/src/styles/index.css+++ b/src/styles/index.css@@ -6,9 +6,9 @@ body {-webkit-font-smoothing: antialiased;-moz-osx-font-smoothing: grayscale;background-color: #1f2c38;+ text-shadow: 0px 1px 1px #1f2c38;}*::selection {background-color: rgba(255, 255, 0, 0.6);- text-shadow: 0px 1px 3px #1f2c38;}\ No newline at end of file