https://github.com/fitri-hy/mysql-endpoint-express
Connecting ExpressJS to MySQL and creating an API Endpoint.
https://github.com/fitri-hy/mysql-endpoint-express
api endpoint express mysql mysql-express
Last synced: 7 months ago
JSON representation
Connecting ExpressJS to MySQL and creating an API Endpoint.
- Host: GitHub
- URL: https://github.com/fitri-hy/mysql-endpoint-express
- Owner: fitri-hy
- License: mit
- Created: 2024-03-29T14:57:00.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-05-09T00:00:40.000Z (over 1 year ago)
- Last Synced: 2025-02-20T05:18:04.215Z (8 months ago)
- Topics: api, endpoint, express, mysql, mysql-express
- Language: PHP
- Homepage: https://www.npmjs.com/package/mysql-endpoint-express
- Size: 347 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# MySQL Conecction ExpressJS
Connecting ExpressJS to MySQL and creating an API Endpoint Automations.
### V1.0.6
[ADD] Role Statement
### V1.0.5
[ADD] Set request CORS in .env
### V1.0.3
[ADD] Method Operation Created, Read, Update, & Delete
### V1.0.2
[FIX] Cors Request## NPM Installation
```sh
git clone https://github.com/fitri-hy/mysql-endpoint-express.git
cd mysql-endpoint-express
npm i mysql-endpoint-express
```## Create & Configuration .env
```sh
DB_HOST=localhost
DB_PORT=5000
DB_USER=username
DB_PASSWORD=password
DB_DATABASE=databasePREFIX_ROLE='admin'
ALLOWED_ORIGIN='*'
ALLOWED_METHODS='GET, POST, PUT, DELETE'
ALLOWED_HEADERS='Content-Type, Authorization'
```
## Implementation index.js
```
require('mysql-endpoint-express');
```## Run Server
```
node index.js`
```## Testing Endpoint
Open in browser: `http://localhost:5000/api`
Don't forget to give stars
Follow Me: FOLLOW