mirror of
https://github.com/ION606/argo-temp.git
synced 2026-05-15 04:16:53 +00:00
added initial istio BLAHAJ code
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
// bun, es modules, minimal deps; one file serves all three services
|
||||
import http from 'http';
|
||||
|
||||
const serviceName = process.env.SERVICE_NAME || 'blahaj';
|
||||
const emoji = process.env.SERVICE_EMOJI || '🦈';
|
||||
const friend = process.env.FRIEND_NAME || 'sea-friend';
|
||||
const port = Number(process.env.PORT || 8080);
|
||||
|
||||
const ascii = `
|
||||
__
|
||||
_.-' \\
|
||||
_.-' _.-'\\) ${emoji} // ascii blahaj says hi!
|
||||
(____.-' ~ waves ~
|
||||
`;
|
||||
|
||||
const server = http.createServer((req, res) => {
|
||||
const path = req.url || '/';
|
||||
const message = {
|
||||
service: serviceName,
|
||||
says: `hello, ${friend}! i am ${serviceName} ✨`,
|
||||
path,
|
||||
mascot: 'BLÅHAJ',
|
||||
fun: 'soft, cuddly shark energy',
|
||||
};
|
||||
res.setHeader('content-type', 'application/json; charset=utf-8');
|
||||
res.end(JSON.stringify({ message, ascii }));
|
||||
});
|
||||
|
||||
server.listen(port, () => {
|
||||
console.log(`${serviceName} listening on ${port};`);
|
||||
});
|
||||
Reference in New Issue
Block a user