Skip to content

Commit

Permalink
Fixing?
Browse files Browse the repository at this point in the history
  • Loading branch information
cryptiklemur committed May 16, 2023
1 parent 7b4f566 commit 752160a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 26 deletions.
2 changes: 1 addition & 1 deletion apps/bot/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ COPY dist/apps/bot /app
# The bundled output will include external dependencies.
RUN npm --omit=dev -f install && npm i source-map-support

CMD [ "node", "-r", "source-map-support/register", "index.mjs" ]
CMD [ "node", "-r", "source-map-support/register", "index.js" ]
2 changes: 1 addition & 1 deletion apps/bot/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@
},
"private": true,
"repository": "aequasi/node-bambu/tree/main/apps/bot",
"type": "commonjs"
"type": "module"
}
11 changes: 4 additions & 7 deletions apps/bot/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,12 @@
"main": "apps/bot/src/index.ts",
"tsConfig": "apps/bot/tsconfig.app.json",
"generatePackageJson": true,
"bundle": false,
"bundle": true,
"external": ["node_modules/*", "source-map-support"],
"sourceMap": true,
"format": ["esm"],
"esbuildOptions": {
"sourcemap": true,
"outExtension": {
".js": ".mjs"
}
"sourcemap": true
}
}
},
Expand All @@ -39,9 +36,9 @@
"lintFilePatterns": ["apps/bot/**/*.ts"]
}
},
"docker-build": {
"docker": {
"dependsOn": ["build"],
"command": "docker build -f apps/bot/Dockerfile . -t bot"
"command": "docker build -f apps/bot/Dockerfile . -t node-bambu/bot"
}
},
"tags": []
Expand Down
24 changes: 7 additions & 17 deletions apps/bot/src/app/app.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as path from 'node:path';

import type { FastifyInstance } from 'fastify';
// eslint-disable-next-line import/default
import AutoLoad from '@fastify/autoload';

import Discord from './plugins/discord';
import Sensible from './plugins/sensible';
import Root from './routes/root';

// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface AppOptions {}
Expand All @@ -12,18 +12,8 @@ export async function app(fastify: FastifyInstance, options: AppOptions) {

// Do not touch the following lines

// This loads all plugins defined in plugins
// those should be support plugins that are reused
// through your application
fastify.register(AutoLoad, {
dir: path.join(__dirname, 'plugins'),
options: { ...options },
});
fastify.register(Discord);
fastify.register(Sensible);

// This loads all plugins defined in routes
// define your routes in one of these
fastify.register(AutoLoad, {
dir: path.join(__dirname, 'routes'),
options: { ...options },
});
fastify.register(Root);
}

0 comments on commit 752160a

Please sign in to comment.