more news
parent
d534ce6a07
commit
12bf471068
|
@ -124,7 +124,7 @@
|
||||||
toggleLoader(true);
|
toggleLoader(true);
|
||||||
|
|
||||||
try{
|
try{
|
||||||
const url = new URL('/api/articles', window.location.origin);
|
const url = new URL('/news/api/articles', window.location.origin);
|
||||||
if (lastId !== undefined) url.searchParams.set('last', lastId);
|
if (lastId !== undefined) url.searchParams.set('last', lastId);
|
||||||
url.searchParams.set("count", "5")
|
url.searchParams.set("count", "5")
|
||||||
|
|
||||||
|
|
|
@ -115,7 +115,7 @@
|
||||||
const errorEl = document.getElementById('error');
|
const errorEl = document.getElementById('error');
|
||||||
|
|
||||||
// Change this to the full path of your API if it differs
|
// Change this to the full path of your API if it differs
|
||||||
const ENDPOINT = '/api/articles?count=25';
|
const ENDPOINT = '/news/api/articles?count=25';
|
||||||
|
|
||||||
fetch(ENDPOINT)
|
fetch(ENDPOINT)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
|
|
|
@ -230,7 +230,7 @@
|
||||||
toggleLoader(true);
|
toggleLoader(true);
|
||||||
|
|
||||||
try{
|
try{
|
||||||
const url = new URL('/api/search', window.location.origin);
|
const url = new URL('/news/api/search', window.location.origin);
|
||||||
url.searchParams.set('text', currentQuery);
|
url.searchParams.set('text', currentQuery);
|
||||||
url.searchParams.set('count', PAGE_SIZE);
|
url.searchParams.set('count', PAGE_SIZE);
|
||||||
if (lastId !== undefined) url.searchParams.set('last', lastId);
|
if (lastId !== undefined) url.searchParams.set('last', lastId);
|
||||||
|
|
|
@ -218,7 +218,7 @@
|
||||||
(function main(){
|
(function main(){
|
||||||
const qs = new URLSearchParams(window.location.search);
|
const qs = new URLSearchParams(window.location.search);
|
||||||
const url = qs.get('url');
|
const url = qs.get('url');
|
||||||
const API = '/api/view_article?url=' + encodeURIComponent(url ?? '');
|
const API = '/news/api/view_article?url=' + encodeURIComponent(url ?? '');
|
||||||
|
|
||||||
const elTopics = document.getElementById('topics');
|
const elTopics = document.getElementById('topics');
|
||||||
const elSummary = document.getElementById('summary');
|
const elSummary = document.getElementById('summary');
|
||||||
|
|
Loading…
Reference in New Issue