{"id":19302042,"url":"https://github.com/adamjatim/express-mysql","last_synced_at":"2026-05-12T12:36:21.393Z","repository":{"id":199696985,"uuid":"703529263","full_name":"adamjatim/express-mysql","owner":"adamjatim","description":null,"archived":false,"fork":false,"pushed_at":"2023-10-11T12:20:29.000Z","size":80,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-05T23:12:25.519Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/adamjatim.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-10-11T12:14:35.000Z","updated_at":"2023-10-11T12:20:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"e3e853e6-ee11-4d29-affc-f65f511694df","html_url":"https://github.com/adamjatim/express-mysql","commit_stats":null,"previous_names":["adamjatim/express-mysql"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamjatim%2Fexpress-mysql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamjatim%2Fexpress-mysql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamjatim%2Fexpress-mysql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamjatim%2Fexpress-mysql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adamjatim","download_url":"https://codeload.github.com/adamjatim/express-mysql/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240404336,"owners_count":19796056,"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":[],"created_at":"2024-11-09T23:19:45.984Z","updated_at":"2025-11-17T12:03:56.970Z","avatar_url":"https://github.com/adamjatim.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Core :\n---\n1. Node Js (Backend)\n\nDatabase :\n---\n1. MySQL (Database)\n\nPackages/Modules :\n---\n1. Express Js (Framework Based on NodeJs)\n2. Express Session (Storing Session Messages)\n3. Dotenv (Environment Variables)\n4. Nodemon (Monitoring Server)\n5. mysql2 (MySQL client for NodeJS)\n6. Multer (Middleware multipart/form-data)\n\nCommand :\n---\n  1. `npm init`\n  2. `npm i express dotenv nodemon mysql2 multer`\n\n\u003cbr\u003e\n\nBasic Routing :\n---\n\n```js\napp.method(path, handler);\n```\n`app.use()` bisa menggunakan semua method (GET, POST, dll) sehingga biasa digunakan sebagai middleware\n\n```js\napp.use(\"/\", (req, res, next) =\u003e {\n  res.send('Hello World'); // \u003c-- memberikan respon text kepada client \n});\n```\n\nbisa juga lebih spesifik seperti GET dan POST\nparameter next hanya bisa digunakan untuk middleware,\njadi tidak perlu dituliskan untuk method yang lebih\nspesifik\n\n```js\napp.get(\"/\", (req, res) =\u003e {\n  res.send('Hello from GET');\n});\n\napp.post(\"/\", (req, res) =\u003e {\n  res.send('Hello from POST');\n});\n\n```\n\nrespon yang diberikan bisa juga dalam bentuk html, atau JSON\n```js\napp.get(\"/\", (req, res) =\u003e {\n  res.send('\u003ch1\u003eHello with HTML\u003c/h1\u003e');\n});\n\napp.post(\"/\", (req, res) =\u003e {\n  res.json({\n    message: \"Hello with JSON\"\n  });\n});\n\n```\n\nuntuk menjalankan node server perlu adanya port\n```js\n\napp.listen(4000, () =\u003e {\n  console.log(\"Server berjalan di port 4000\");\n});\n```\n\n\u003cbr\u003e\n\nStruktur Folder Project :\n---\n./\u003cbr\u003e\n|-- node_modules\u003cbr\u003e\n|-- src/\u003cbr\u003e              \n    |-- config/       \u003c-- setup database\u003cbr\u003e\n    |-- controller/   \u003c-- sebuah fungsi yang digunakan didalam routes/\u003cbr\u003e\n    |-- middleware/   \u003c-- middleware\u003cbr\u003e\n    |-- models/       \u003c-- untuk menyimpan fungsi-fungsi call ke DB\u003cbr\u003e\n    |-- routes/       \u003c-- mengumpulkan semua PATH, Users, Products, Sales, dst...\u003cbr\u003e\n    |-- ./index.js    \u003c-- main project\u003cbr\u003e\n\u003cbr\u003e\n\n# HTTP Status Code : \n\n**Successful Responses (2xx)**\n- 200 OK (GET, PATCH)\n- 201 Created (POST, PUT)\n\n**Client Error Responses (4xx)**\n- 400 Bad Request\n- 401 Unauthorized\n- 403 Forbidden\n- 404 Not Found\n- 405 Method Not Allowed\n\n**Server error responses (5xx)**\n- 500 Internal Server Error\n\n**Source**\n- https://rapidapi.com/guides/http-status-code\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadamjatim%2Fexpress-mysql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadamjatim%2Fexpress-mysql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadamjatim%2Fexpress-mysql/lists"}