https://github.com/oneplc/plc-xi-api-core
Core API for PLC X I
https://github.com/oneplc/plc-xi-api-core
Last synced: about 1 month ago
JSON representation
Core API for PLC X I
- Host: GitHub
- URL: https://github.com/oneplc/plc-xi-api-core
- Owner: OnePlc
- License: bsd-3-clause
- Created: 2022-11-04T17:29:21.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-11-27T02:26:19.000Z (over 2 years ago)
- Last Synced: 2025-03-01T16:38:42.342Z (2 months ago)
- Language: PHP
- Size: 203 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# onePlace XI Api Core
Core Module for onePlace XI Api Server.## How to start locally
- Enter Projekt directory, run `composer install`
- Create `config/autoload/local.php`
- Start Dev Server `php -S 0.0.0.0:8080 -t public public/index.php`
- The API is now running on localhost:8080```php
return [
'db' => [
'adapters' => [
'api' => [
'database' => 'nameOfYourDatabase',
'driver' => 'PDO_Mysql',
'username' => 'databaseUser',
'password' => 'databasePassword',
],
],
],
'api-tools-mvc-auth' => [
'authentication' => [
'adapters' => [
'api' => [
'adapter' => \Laminas\ApiTools\MvcAuth\Authentication\OAuth2Adapter::class,
'storage' => [
'adapter' => \pdo::class,
'dsn' => 'mysql:dbname=nameOfYourDatabase;host=localhost;charset=utf8',
'route' => '/oauth',
'username' => 'databaseUser',
'password' => 'databasePassword',
],
],
],
],
],
];
```## Configure Authentication
- Insert a new row into `oauth_clients` table
- `client_id` is the username for your client
- `client_secret` is the hashed password for your client
- You can use `php .\vendor\laminas-api-tools\api-tools-oauth2\bin\bcrypt.php yourPassword` to generate a bcrypt hash