lndgalante / faucy Goto Github PK
View Code? Open in Web Editor NEW🚰 Get ethers from any testnet easily
Home Page: https://faucy.dev
🚰 Get ethers from any testnet easily
Home Page: https://faucy.dev
prevRequest in some way is not working
app.get('/healthcheck', (req, res) => {
res.status(200).json({
statusCode: 200,
body: { message: 'The service is running.' },
});
});
i need georli test PLEASE HELP
0x5A8Dc9347252Cd63f3f0d97120ecdAD9302d7925
Now we have only one endpoint for /health
router
app.js
app.use('/health', healthRouter);
modules/health/router.js
healthRouter.get('/check', (req, res) => {
res.status(200).json({ statusCode: 200, body: { message: 'The service is running' } });
});
Inside this last router we will need to add an new .get
method per each Faucet checking if it's UP or not.
As an example:
// Utils
const { wretch } = require('../../utils/fetch');
// Constants - Environment variables
const { RINKEBY_FAUCET_URL } = process.env;
healthRouter.get('/health/rinkeby', async (req, res) => {
try {
await wretch(RINKEBY_URL).get();
res.status(200).json({ statusCode: 200, body: { message: 'Rinkeby is running' } });
} catch (error) {
res.status(503).json({ statusCode: 503, body: { message: 'Rinkeby is down' } });
}
});
---
On the frontend side, we need to trigger a call to each of one of these new endpoints.
Util example were it checks if all services are up or down regarding the status code you will receive all the info.
```javascript
export const checkAllServices = async () => {
const services = ['kovan', 'rinkeby', 'goerli', 'ropsten'];
const promises = services.map(async (service) => {
const status = await faucyApi.url(`/health/${service}`).get().json();
return status;
});
const results = Promise.allSettled(promises);
return results;
};
Read: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/allSettled
In did mount of the form we will need to run this util and afterwards set it on some React state therefore we can use it on the UI.
Bot de Twitter que detecte los hashtags #Rinkeby por ej y le contestemos con algo así:
“Hi [TWITTER_HANDLE] :hola: We’re developing Faucy to get ethers from any testnet easily! You can reach us through @wearexivis or telegram. https://faucy.dev”
We can also avoid using http-delayed-response
related logic
The following UI bug will be fixed on the next Chakra UI release
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.