Skip to content
Snippets Groups Projects
Commit 9bbe1270 authored by Alexander Kehr's avatar Alexander Kehr
Browse files

init

parents
Branches
No related tags found
No related merge requests found
/node_modules/
/.idea/
/dist/
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
This diff is collapsed.
{
"name": "makemkv-api",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"lint": "eslint src",
"lint:fix": "eslint src --fix",
"start": "tsc-watch --outDir ./dist --onSuccess \"node dist/index.js\"",
"start:prod": "node dist/index.js",
"build": "tsc -b ."
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"@types/express": "^4.17.11",
"@types/node": "^17.0.23",
"eslint": "^8.11.0",
"tsc-watch": "^4.6.2",
"typescript": "^4.6.2"
},
"dependencies": {
"routing-controllers": "^0.9.0"
}
}
import path from "path";
import {Action, createExpressServer} from "routing-controllers";
export const routingControllerOptions = {
routePrefix: "/api",
controllers: [path.join(__dirname + '/controller/*.js')],
authorizationChecker: async (action: Action, roles: string[]) : Promise<boolean> => {
return action.request.headers['authorization'] === "fnzui3cughf834zocgh3dfmq8ochd38qoid34";
}
}
export const startServer = async () => {
const app = createExpressServer(routingControllerOptions);
const server = app.listen(8080, () => {
console.log(`makemkv-api listening at http://0.0.0.0:8080`);
});
}
startServer();
\ No newline at end of file
{
"compilerOptions": {
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"module": "commonjs",
"target": "es5",
"sourceMap": true,
"outDir": "./dist",
"strict": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"skipLibCheck": true
},
"exclude": [
"node_modules"
]
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment