Skip to content

Commit 240fb4e

Browse files
release v1.0.0
1 parent b79e10f commit 240fb4e

File tree

2 files changed

+67
-0
lines changed

2 files changed

+67
-0
lines changed

README.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Create Php Rest API Application
2+
3+
## Installation
4+
Run the Composer command to install the latest stable version of RestJS:
5+
6+
```
7+
composer create-project restjs/restapi
8+
```
9+
10+
## Getting Started
11+
- Create new **Database** with `database_name`.
12+
- Import php-rest-api.sql file in **MySQL Database**.
13+
- Configure database variables in .env:
14+
15+
```
16+
HOST_NAME = ''
17+
USER_NAME = ''
18+
PASSWORD = ''
19+
DATABASE_NAME = ''
20+
ACCESS_TOKEN = ''
21+
```
22+
23+
### Used Feature
24+
> `json`, `headers_authorization`, `upload_file`, `access_token`
25+
26+
### Quick links
27+
1. [**Get API**](http://localhost/test/access_token=<Access_Token>) for `GET`, `POST`, `PUT`, `DELETE`
28+
2. [**Upload File**](http://localhost/file/access_token=<Access_Token>) for `POST`, `DELETE`
29+
30+
### API Routes
31+
| HTTP Method | Path | Action | Scope | Desciption |
32+
| ----- | ----- | ----- | ---- |------------- |
33+
| GET | /<table_name> | index | data:list | Get all data
34+
| POST | /<table_name> | store | data:create | Create an data
35+
| GET | /<table_name>/{_id} | show | data:read | Fetch an data by id
36+
| PUT | /<table_name>/{_id} | update | data:write | Update an data by id
37+
| DELETE | /<table_name>/{_id} | destroy | data:delete | Delete an data by id

composer.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,36 @@
11
{
2+
"name": "restjs/rest-api",
3+
"description": "Create Rest API Application",
4+
"type": "project",
5+
"keywords": [
6+
"php",
7+
"composer",
8+
"rest-api",
9+
"file-upload",
10+
"web-services",
11+
"jwt-authentication",
12+
"my-sql"
13+
],
14+
"homepage": "https://github.com/fullstackondemand/rest-api",
15+
"license": "MIT",
16+
"authors": [
17+
{
18+
"name": "Pramod Singh",
19+
"email": "spramodgusain@gmail.com",
20+
"homepage": "https://github.com/fullstackondemand",
21+
"role": "Developer"
22+
}
23+
],
24+
"minimum-stability": "dev",
25+
"prefer-stable": true,
226
"require": {
27+
"php": "7.1.*|7.2.*|7.3.*|7.4.*|8.0.*|8.1.*",
328
"restjs/php-rest-api": "^1.5",
429
"vlucas/phpdotenv": "^5.6"
30+
},
31+
"scripts": {
32+
"post-create-project-cmd": [
33+
"mkdir uploads"
34+
]
535
}
636
}

0 commit comments

Comments
 (0)