{"id":17465511,"url":"https://github.com/vriskaserket51/common-api","last_synced_at":"2025-03-28T08:14:12.362Z","repository":{"id":65431417,"uuid":"591903260","full_name":"VriskaSerket51/common-api","owner":"VriskaSerket51","description":"Simple Backend framework with JWT and MySQL support","archived":false,"fork":false,"pushed_at":"2024-02-15T17:44:00.000Z","size":159,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-28T04:35:59.842Z","etag":null,"topics":["backend-api","framework","jwt","mysql"],"latest_commit_sha":null,"homepage":"https://npmjs.com/package/@ireves/common-api","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/VriskaSerket51.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-01-22T09:38:43.000Z","updated_at":"2024-02-02T15:14:22.000Z","dependencies_parsed_at":"2024-02-02T15:15:16.370Z","dependency_job_id":"7fbe791d-60e1-40d8-9790-cd8e347c8c66","html_url":"https://github.com/VriskaSerket51/common-api","commit_stats":{"total_commits":21,"total_committers":2,"mean_commits":10.5,"dds":0.1428571428571429,"last_synced_commit":"faba3fdc01b52ce1de1bbcf7e6ed8dfeae13357a"},"previous_names":["vriskaserket51/common-api","vriskaserket51/common-api-ts"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VriskaSerket51%2Fcommon-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VriskaSerket51%2Fcommon-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VriskaSerket51%2Fcommon-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VriskaSerket51%2Fcommon-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/VriskaSerket51","download_url":"https://codeload.github.com/VriskaSerket51/common-api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245991584,"owners_count":20706129,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["backend-api","framework","jwt","mysql"],"created_at":"2024-10-18T12:05:49.388Z","updated_at":"2025-03-28T08:14:12.335Z","avatar_url":"https://github.com/VriskaSerket51.png","language":"TypeScript","readme":"# common-api\n\nSimple backend framework with JWT and MySQL support.\n\n## Installation into an existing project\n\nTo install `common-api` as a dependency of your Node.js project:\n\n```sh\nnpm install @ireves/common-api\n```\n\n`common-api` is made with TypeScript.\n\n## How to use\n\n```javascript\nimport CommonApi from \"@ireves/common-api\";\nimport path from \"path\";\n\nCommonApi.initializeConfig(config);\nCommonApi.initializeScheduler(schedules);\n\nrunExpressApp();\n\nfunction runExpressApp() {\n    const app = new CommonApi.App(\n        path.join(__dirname, \"router\"),\n        [],\n        CommonApi.defaultRouterMiddlewares,\n        []\n    );\n    app.run(\n        config.port,\n        () =\u003e {\n            console.info(`Server started with port: ${config.port}`);\n        },\n        (error) =\u003e {\n            CommonApi.logger.error(error);\n        }\n    );\n}\n```\n\n```javascript\nconst config: CommonApi.Config = {\n    jwtSecret: \"secret\",\n    db: {\n        host: \"127.0.0.1\",\n        port: 3306,\n        user: \"root\",\n        password: \"password\",\n        database: \"db\",\n    },\n};\n```\n\n```javascript\nconst schedules: CommonApi.Schedule[] = [\n    name: \"testSchedule\",\n    cron: \"00 00 00 * * *\",\n    job: () =\u003e {\n        console.log(\"Welcome!\")\n    },\n];\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvriskaserket51%2Fcommon-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvriskaserket51%2Fcommon-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvriskaserket51%2Fcommon-api/lists"}