forked from tanner/qotnews
progress
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
import fetch from 'isomorphic-fetch';
|
||||
|
||||
const API_URL = process.env.API_URL || 'http://news.1j.nz';
|
||||
|
||||
export async function get(req, res) {
|
||||
const { skip, limit } = {
|
||||
skip: req.query.skip || 0,
|
||||
limit: req.query.limit || 20,
|
||||
};
|
||||
const response = await fetch(`${API_URL}/api/search?q=${req.query.q}&skip=${skip}&limit=${limit}`);
|
||||
res.writeHead(response.status, { 'Content-Type': 'application/json' });
|
||||
res.end(await response.text());
|
||||
}
|
||||
Reference in New Issue
Block a user