In order to work on the API, you'll need to install the source version locally. The application sourcecode is being hosted in the directus/api repo on GitHub.
- A HTTP Web Server that supports URL rewrites
- Comes with .htaccess included for Apache
- MySQL 5.2+
- Database (empty or existing)
- Database User (with access to database)
- PHP 5.6+ or 7.0+
pdo
+mysql
curl
gd
fileinfo
mbstring
- Node.js v8.11.3 or higher (preferably v10.6+)
- Git to fetch the source code from GitHub
- Composer to install dependencies
:::warning Important Click here to learn more about these system requirements, neccesary permissions, and other important and server-specific prerequisites. :::
Clone the repo by running
git clone https://github.com/directus/api.git
OR
git clone [email protected]:directus/api.git
::: warning Fork
If you want to work on your fork of the project, remember to replace directus
with your GitHub username in the url above
:::
composer install
cd extensions
npm install
npm run build
::: tip Development mode
Just like the app, if you'd like to actively work on Extensions, use npm run dev
instead of npm run build
.
:::
On your local server, create a new database to use with the API.
The API uses a config file to know which database to connect to. Copy or rename the /config/api_example.php
file to /config/api.php
and edit the settings as indicated.
::: tip You can download a demo SQL schema to skip the API's installation process. :::