itszubariel commited on
Commit
cdcbf0a
·
1 Parent(s): 68463fa

removed 404 return to prevent out of sync

Browse files
Files changed (2) hide show
  1. Dockerfile +1 -1
  2. src/server.ts +2 -5
Dockerfile CHANGED
@@ -1,6 +1,6 @@
1
  FROM node:20-slim
2
  RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
3
- ARG CACHEBUST=67
4
  RUN curl -L https://github.com/zbrlang/zbr/releases/latest/download/zbr-linux-x64 -o /usr/local/bin/zbr && chmod +x /usr/local/bin/zbr
5
  WORKDIR /app
6
  COPY package*.json ./
 
1
  FROM node:20-slim
2
  RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
3
+ ARG CACHEBUST=100
4
  RUN curl -L https://github.com/zbrlang/zbr/releases/latest/download/zbr-linux-x64 -o /usr/local/bin/zbr && chmod +x /usr/local/bin/zbr
5
  WORKDIR /app
6
  COPY package*.json ./
src/server.ts CHANGED
@@ -89,11 +89,8 @@ function stopBot(key: string): boolean {
89
 
90
  app.post('/stop', (req: Request<{}, any, StopRequestBody>, res: Response) => {
91
  const { botId, discordId } = req.body;
92
- if (stopBot(`${discordId}-${botId}`)) {
93
- res.json({ success: true, status: 'stopped' });
94
- } else {
95
- res.status(404).send('Bot not running');
96
- }
97
  });
98
 
99
  app.get('/status/:discordId/:botId', (req: Request, res: Response) => {
 
89
 
90
  app.post('/stop', (req: Request<{}, any, StopRequestBody>, res: Response) => {
91
  const { botId, discordId } = req.body;
92
+ stopBot(`${discordId}-${botId}`);
93
+ res.json({ success: true, status: 'stopped' });
 
 
 
94
  });
95
 
96
  app.get('/status/:discordId/:botId', (req: Request, res: Response) => {