diff --git a/README.md b/README.md index 49d5a9a..5ab9e01 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,9 @@ This app uses a local instance of Searx.ng to get Google (Startpage) results and ## Usage -to run just run +to deploy, just run ``` cd app/ -make run +make rebuild ``` \ No newline at end of file diff --git a/TODO b/TODO index f6f3cb5..e69de29 100644 --- a/TODO +++ b/TODO @@ -1 +0,0 @@ -TODO: add documentation \ No newline at end of file diff --git a/app/src/app.js b/app/src/app.js index e30b054..7da3886 100644 --- a/app/src/app.js +++ b/app/src/app.js @@ -7,6 +7,7 @@ const app = express(); // specifying the folder with the static content - html+css app.use(express.static(__dirname + '/static')); +// root route, serving the czech version by default app.get('/', (req, res) => { res.sendFile(path.join(__dirname, '/static/cs/index.html')); }); @@ -15,6 +16,7 @@ app.get('/en', (req, res) => { res.sendFile(path.join(__dirname, '/static/en/index.html')); }); +// the search route serves the czech language by default app.get('/search', (req, res) => { handleSearch(req, res, "cz-CS"); }); diff --git a/app/src/search.js b/app/src/search.js index e18e936..354d31b 100644 --- a/app/src/search.js +++ b/app/src/search.js @@ -20,7 +20,7 @@ async function handleSearch(req, res, lang) { q: query, engines: "startpage", format: "json", - category_general: 1, + category_general: 1, // this is needed for an accurate language choice by searx.ng language: lang }); console.log(`${searxngUrl}/search?${params}`);