{"id":22636758,"url":"https://github.com/hafizcode02/simple-restapi-mysql","last_synced_at":"2026-04-11T19:33:05.678Z","repository":{"id":208571346,"uuid":"717947998","full_name":"hafizcode02/simple-restapi-mysql","owner":"hafizcode02","description":"Creating Example of Rest API using Express, MySQL, Multer, Express-Validator","archived":false,"fork":false,"pushed_at":"2023-12-01T13:46:43.000Z","size":390,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-10T00:06:33.258Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/hafizcode02.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-13T03:00:05.000Z","updated_at":"2025-04-09T14:46:28.000Z","dependencies_parsed_at":"2023-11-22T07:30:14.202Z","dependency_job_id":"825ff9cd-b87f-4f00-aea1-0cdb424b45cf","html_url":"https://github.com/hafizcode02/simple-restapi-mysql","commit_stats":null,"previous_names":["hafizcode02/simple-restapi-mysql"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hafizcode02/simple-restapi-mysql","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hafizcode02%2Fsimple-restapi-mysql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hafizcode02%2Fsimple-restapi-mysql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hafizcode02%2Fsimple-restapi-mysql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hafizcode02%2Fsimple-restapi-mysql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hafizcode02","download_url":"https://codeload.github.com/hafizcode02/simple-restapi-mysql/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hafizcode02%2Fsimple-restapi-mysql/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31693272,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-11T13:07:20.380Z","status":"ssl_error","status_checked_at":"2026-04-11T13:06:47.903Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["express-js","express-validator","multer","mysql"],"created_at":"2024-12-09T03:30:07.734Z","updated_at":"2026-04-11T19:33:05.646Z","avatar_url":"https://github.com/hafizcode02.png","language":"JavaScript","readme":"# restapi-mysql\nCreating Example Rest API using Express, MySQL, Multer.\n\n```markdown\n# Express.js simple rest api with mysql and Multer for uploading image.\n\nThis is a simple example of an Express.js rest api with mysql and Multer for uploading image..\n\n## Prerequisites\n\nBefore running the application, make sure you have the following installed on your machine:\n\n- [Node.js](https://nodejs.org/)\n- [npm](https://www.npmjs.com/) (Node Package Manager)\n```\n\n## Getting Started\n\n1. Clone this repository to your local machine:\n\n   ```bash\n   git clone https://github.com/Hafizcode02/restapi-mysql.git\n   ```\n\n2. Navigate to the project directory:\n\n   ```bash\n   cd restapi-mysql\n   ```\n\n3. Install the dependencies:\n\n   ```bash\n   npm install\n   ```\n\n## SETTING UP .ENV File\n\nbefore starting running the application, set env file based on your needs:\n\n```bash\nPORT=XXXX\nDB_HOST=XXX\nDB_USERNAME=XXXX\nDB_PASSWORD=XXXX\nDB_NAME=XXXX\n```\n\nSQL File is in folder, just import it..\n\n## Running the Application\n\nTo start the Express.js server and run the file upload example, use the following command:\n\n```bash\nnpm start run-dev\n```\n\nThis will start the server on [http://localhost:ENV_PORT](http://localhost:ENV_PORT) or in port 8004.\n\n## File Upload\n\n- The file upload route is configured at `/upload`.\n- Only specific file types (JPEG, PNG, and PDF) are allowed.\n\n## API Endpoint List\n\n```bash\n[POST] your-site/users\n[GET] your-site/users\n[GET] your-site/users/:id\n[PATCH] your-site/users/:id\n[DELETE] your-site/users/:id\n[POST] your-site/upload/\n```\n\n## Your Body Data\n```\nFor POST, PATCH users use raw JSON type\n{\n    \"name\" : \"Argh Satrio\",\n    \"email\" : \"landa@gmail.com\",\n    \"address\": \"World\"\n}\n\nFor POST images/files, use form-data type. \n\nphoto : abcd.jpg\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhafizcode02%2Fsimple-restapi-mysql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhafizcode02%2Fsimple-restapi-mysql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhafizcode02%2Fsimple-restapi-mysql/lists"}