Download the PHP package cashwarden/api without Composer
On this page you can find all versions of the php package cashwarden/api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download cashwarden/api
More information about cashwarden/api
Files in cashwarden/api
Informations about the package api
Yii 2 REST API Project Template
Yii 2 REST API Project Template is a skeleton Yii 2 application best for rapidly creating small rest api projects.
The template contains the basic features including user join/login api. It includes all commonly used configurations that would allow you to focus on adding new features to your application.
REQUIREMENTS
The minimum requirement by this project template that your Web server supports PHP 7.2.0.
INSTALLATION
Install via Composer
If you do not have Composer, you may install it by following the instructions at getcomposer.org.
You can then install this project template using the following command:
composer create-project --prefer-dist cashwarden/api <rest-api>
cd <rest-api>
cp .env.example .env
chmod 777 -R runtime/
chmod 777 -R web/uploads/
php yii migrate
php yii generate/key # optional
Now you should be able to access the application through the following URL, assuming rest-api
is the directory
directly under the Web root.
http://localhost/<rest-api>/web/
Install from GitHub
Accessing Use this template Create a new repository from yii2-rest-api
You can then access the application through the following URL:
http://localhost/<rest-api>/web/
Install with Docker
Update your vendor packages
Run the installation triggers (creating cookie validation code)
Start the container
You can then access the application through the following URL:
NOTES:
- Minimum required Docker engine version
17.04
for development (see Performance tuning for volume mounts) - The default configuration uses a host-volume in your home directory
.docker-composer
for composer caches
Check out the packages
Use
At this time, you have a RESTful API server running at http://127.0.0.1:8000
. It provides the following endpoints:
GET /health-check
: a health check service provided for health checking purpose (needed when implementing a server cluster)POST /v1/join
: create a userPOST /v1/login
: authenticates a user and generates a JWTPOST /v1/refresh-token
: refresh a JWT
Try the URL http://localhost:8000/health-check
in a browser, and you should see something like {"code":0,"data":"OK","message":"成功"}
displayed.
If you have cURL
or some API client tools (e.g. Postman), you may try the following
more complex scenarios:
All versions of api with dependencies
yiisoft/yii2 Version ~2.0.14
yiisoft/yii2-swiftmailer Version ~2.0.0 || ~2.1.0
yiithings/yii2-dotenv Version ^1.0
sizeg/yii2-jwt Version ^2.0
yiier/yii2-helpers Version ^2.0
yiier/yii2-graylog-target Version ^1.1
yiier/yii2-validators Version ^0.3.0
mis/yii2-ide-helper Version ^1.0
telegram-bot/api Version ^2.3
ext-json Version *
ext-bcmath Version *
guzzlehttp/guzzle Version ^7.0