Skip to content

Commit

Permalink
Update proxy.js
Browse files Browse the repository at this point in the history
  • Loading branch information
hello-world-1989 committed Apr 22, 2024
1 parent 4caa01f commit eb864f9
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ app.set('view engine', 'handlebars');
app.set('views', path.join(__dirname, './views'));

app.use('/', express.static(path.join(__dirname, '../public/temp')));

app.use('/android', express.static(path.join(__dirname, '../android')));
app.use('/windows', express.static(path.join(__dirname, '../windows')));
app.use(
Expand Down Expand Up @@ -458,6 +459,17 @@ app.use('/node', async (req, res) => {
}
});

app.use('/check-status', async (req, res) => {
try {
const result = await isPortReachable('baidu.com', 80, 3000);

res.send(result);
} catch (err) {
console.log(err);
res.send(false);
}
});

async function fetchAPI() {
const url =
'https://raw.githubusercontent.com/hello-world-1989/cn-news/main/end-gfw-together';
Expand Down

0 comments on commit eb864f9

Please sign in to comment.