Skip to content

Commit

Permalink
tidy up standard-server example
Browse files Browse the repository at this point in the history
  • Loading branch information
valgaze committed Jun 19, 2024
1 parent e0ec532 commit 075fb4c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion examples/standard-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,14 @@
"author": "valgaze@gmail.com",
"license": "ISC",
"devDependencies": {
"tsx": "^4.7.0",
"@types/express": "^4.17.21",
"@types/node": "^20.10.1",
"tsx": "^4.7.0",
"typescript": "^3.9.10"
},
"dependencies": {
"body-parser": "^1.19.0",
"cross-fetch": "^4.0.0",
"dotenv": "^16.0.3",
"express": "^4.17.1",
"speedybot": "^2.0.0"
Expand Down
2 changes: 1 addition & 1 deletion examples/standard-server/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as bodyParser from "body-parser";
import { config } from "dotenv";
import * as express from "express";
import express from "express";
import { resolve } from "path";
import Bot from "./../settings/bot";
import { validateWebhook } from "./validateWebhook";
Expand Down
6 changes: 4 additions & 2 deletions examples/standard-server/util/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ export const announceReady = (
) => {
const isColorSupported = process.stdout.isTTY;
console.log(logoRoll());
const msg = `Server active on port ${port}
You must expose this port & register for incoming webhooks. Listening...`;
if (isColorSupported) {
const ServerReady = `\x1b[1m\x1b[7m\x1b[32m 🌐 CONNECTED \x1b[0m\x1b[32m Server active on ${port}, listening...\x1b[0m`;
const ServerReady = `\x1b[1m\x1b[7m\x1b[32m 🌐 CONNECTED \x1b[0m\x1b[32m ${msg}\x1b[0m`;
process.stdout.write(ServerReady + "\n");
} else {
console.log("Websockets Registered. Listening...");
console.log(`🌐 CONNECTED ${msg}`);
}
console.log(`You can reach ${name} here: ${email}`);
};

0 comments on commit 075fb4c

Please sign in to comment.