mirror of
https://github.com/TecharoHQ/anubis.git
synced 2026-04-09 18:18:49 +00:00
* chore: add prettier configuration Signed-off-by: Xe Iaso <me@xeiaso.net> * format: run prettier tree-wide Signed-off-by: Xe Iaso <me@xeiaso.net> * chore(prettier): ignore intentionally ungrammatical files Signed-off-by: Xe Iaso <me@xeiaso.net> * ci: add PR title lint rule Signed-off-by: Xe Iaso <me@xeiaso.net> * ci: add DCO check Signed-off-by: Xe Iaso <me@xeiaso.net> * chore: add commitlint and husky Signed-off-by: Xe Iaso <me@xeiaso.net> * chore: add CONTRIBUTING guidelines Signed-off-by: Xe Iaso <me@xeiaso.net> * chore: set SKIP_INTEGRATION in precommit tests Signed-off-by: Xe Iaso <me@xeiaso.net> * chore: update spelling Signed-off-by: Xe Iaso <me@xeiaso.net> * ci(dco): remove reopened trigger Signed-off-by: Xe Iaso <me@xeiaso.net> * chore: remove dead file Signed-off-by: Xe Iaso <me@xeiaso.net> * chore(prettier): don't format nginx includes Signed-off-by: Xe Iaso <me@xeiaso.net> --------- Signed-off-by: Xe Iaso <me@xeiaso.net>
28 lines
629 B
JavaScript
28 lines
629 B
JavaScript
async function getRobotsTxt() {
|
|
return fetch("http://localhost:8923/robots.txt", {
|
|
headers: {
|
|
"Accept-Language": "en",
|
|
"User-Agent": "Mozilla/5.0",
|
|
},
|
|
})
|
|
.then((resp) => {
|
|
if (resp.status !== 200) {
|
|
throw new Error(`wanted status 200, got status: ${resp.status}`);
|
|
}
|
|
return resp;
|
|
})
|
|
.then((resp) => resp.text());
|
|
}
|
|
|
|
(async () => {
|
|
const page = await getRobotsTxt();
|
|
|
|
if (page.includes(`<html>`)) {
|
|
console.log(page);
|
|
throw new Error("serve robots.txt smoke test failed");
|
|
}
|
|
|
|
console.log("serve-robots-txt serves robots.txt");
|
|
process.exit(0);
|
|
})();
|