Skip to content

A pretty dashboard of uptime status based on UptimeRobot API

Notifications You must be signed in to change notification settings

ccknbc-backup/uptime-status

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

uptime-status

一个基于 UptimeRobot API 的在线状态面板

An uptime status dashboard based on UptimeRobot API


基于 Cloudflare Workers 搭建 UptimeRobot API 代理,以解决官网 API 跨域问题

Build an UptimeRobot API proxy based on Cloudflare Workers to solve the cross-domain issue of official API

const handleRequest = async ({ request }) => {
  let url = new URL(request.url);
  let response = await fetch('https://api.uptimerobot.com' + url.pathname, request);
  response = new Response(response.body, response);
  response.headers.set('Access-Control-Allow-Origin', '*');
  response.headers.set('Access-Control-Allow-Methods', '*');
  response.headers.set('Access-Control-Allow-Credentials', 'true');
  response.headers.set('Access-Control-Allow-Headers', 'Content-Type,Access-Token');
  response.headers.set('Access-Control-Expose-Headers', '*');
  return response;
}

addEventListener('fetch', (event) => {
  event.respondWith(handleRequest(event));
});

修改 config.js 中的 ApiDomian 为你的域名;

Modify ApiDomian in config.js to your domain;

About

A pretty dashboard of uptime status based on UptimeRobot API

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 72.7%
  • CSS 24.2%
  • HTML 2.9%
  • Shell 0.2%