Skip to content

Commit

Permalink
feat: Add basePath API friendly user response
Browse files Browse the repository at this point in the history
  • Loading branch information
nicetomytyuk committed Jul 22, 2024
1 parent 10b334d commit 531b0b5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions fly.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ NODE_ENV = "production"
[http_service]
internal_port = 3000
force_https = true
auto_stop_machines = false
auto_stop_machines = true
auto_start_machines = true
min_machines_running = 0
min_machines_running = 1
processes = ['app']

[[vm]]
Expand Down
1 change: 1 addition & 0 deletions src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,6 @@ try {
});
}
} catch (error) {
console.log(error);
process.exit(1);
}
10 changes: 6 additions & 4 deletions src/server/index.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
import { fastify } from "fastify";
import Fastify from "fastify";
import { webhookCallback } from "grammy";
import { Bot } from "../bot/index.js";
import { config } from "../config.js";

export const createServer = async (bot: Bot) => {
const server = fastify();
const server = Fastify({
logger: true
});

server.setErrorHandler(async (error, request, response) => {
await response.status(500).send({ error: "Oops! Something went wrong." });
});

server.get('/', async function handler (request, reply) {
return { success: true }
})
return "Relaps bot is working!"
});

server.get(`/${bot.token}`, async (request, response) => {
const hostname = request.headers["x-forwarded-host"];
Expand Down

0 comments on commit 531b0b5

Please sign in to comment.