Skip to content

Commit

Permalink
adminjs running
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeh committed Oct 7, 2024
1 parent f5f05c8 commit 7981612
Show file tree
Hide file tree
Showing 5 changed files with 218 additions and 11 deletions.
22 changes: 22 additions & 0 deletions admin/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import AdminJS from "adminjs";
import AdminJSExpress from "@adminjs/express";
import express from "express";

const PORT = 3000;

const start = async () => {
const app = express();

const admin = new AdminJS({});

const adminRouter = AdminJSExpress.buildRouter(admin);
app.use(admin.options.rootPath, adminRouter);

app.listen(PORT, () => {
console.log(
`AdminJS started on http://localhost:${PORT}${admin.options.rootPath}`,
);
});
};

void start();
18 changes: 15 additions & 3 deletions admin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,32 @@
"name": "admin",
"version": "1.0.0",
"description": "",
"main": "index.js",
"type": "module",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"start:dev": "nodemon --exec tsx index.ts"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"@adminjs/express": "^6.1.0",
"@adminjs/typeorm": "^5.0.1",
"adminjs": "^7.8.13",
"express": "^4.21.0",
"typeorm": "catalog:",
"express-formidable": "^1.2.0",
"express-session": "^1.18.0",
"nodemon": "^3.1.7",
"pg": "catalog:",
"reflect-metadata": "catalog:",
"tslib": "^2.7.0",
"typeorm": "catalog:",
"typescript": "catalog:"
},
"devDependencies": {
"@types/express": "^4.17.17",
"@types/node": "^22.7.4",
"ts-node": "^10.9.1",
"tsx": "^4.19.1"
}
}
21 changes: 21 additions & 0 deletions admin/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"module": "esnext",
"moduleResolution": "nodenext",
"target": "esnext",
"outDir": "./dist",
"rootDir": "./",
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"resolveJsonModule": true,
"isolatedModules": true,
"skipLibCheck": true,
"paths": {
"@shared/*": ["../shared/*"],
"@api/*": ["../api/src/*"]
}
},
"include": ["./**/*.ts", "../shared/**/*.ts", "../api/**/*.ts"],
"exclude": ["node_modules"]
}
Loading

0 comments on commit 7981612

Please sign in to comment.