Skip to content
This repository has been archived by the owner on May 23, 2024. It is now read-only.

Commit

Permalink
Make module Drupal 9 compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
gnikolovski committed Jul 9, 2020
1 parent 633fd01 commit 4600729
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 103 deletions.
19 changes: 0 additions & 19 deletions .editorconfig

This file was deleted.

1 change: 0 additions & 1 deletion .gitignore

This file was deleted.

84 changes: 32 additions & 52 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,76 +1,56 @@
# Druact API
CONTENTS OF THIS FILE
---------------------

## Intro
* Introduction
* Requirements
* Installation
* Configuration
* Maintainers

This is a Drupal 8 module that will enable all modules and set up configuration
that is required to create a simple decoupled website. To find out more please
visit this blog post:

https://www.gorannikolovski.com/react-js-and-drupal-8-decoupled-website-part-1
INTRODUCTION
------------

This is a Drupal 8/9 module that will enable all modules and setup configuration
that is required to create a simple decoupled website. To find out more please
visit this blog post:

## Demo
https://gorannikolovski.com/react-js-and-drupal-8-decoupled-website-part-1

To see fully functional demo visit the following website:

http:https://druact.gorannikolovski.com
https:https://druact.gorannikolovski.com

## Installation

You can download Druact API module on the Github release page:
REQUIREMENTS
------------

https://github.com/gnikolovski/druact_api/releases
This module depends on the following contrib modules:

1. Composer (recommended):
* Token - https://www.drupal.org/project/token
* REST UI - https://www.drupal.org/project/restui
* Contact message REST - https://www.drupal.org/project/contact_message_rest
* Contact Storage - https://www.drupal.org/project/contact_storage

Since this module is not published on drupal.org or on packagist.org you will
need to add the VCS repository to your composer.json file. You need to add this:

```
"repositories": [
{
"type": "vcs",
"url": "https://github.com/gnikolovski/druact_api"
}
]
```
INSTALLATION
------------

Then you can run the following command to install it:
Run the following command to install it:

```
composer require gnikolovski/druact_api
```

2. Drush:

Since this module is not published on drupal.org you will need to download it
from the Github and place it in your /modules directory. After that execute the
following command:

```
drush en druact_api -y
```

3. Manual installation

To install the Druact API module, proceed in the usual way: download and unzip
it, then place it in the /modules directory for your site. Navigate to the
Extend page (admin/modules) and install Druact API.

You also need to download the following required modules:
CONFIGURATION
-------------

Token https://www.drupal.org/project/token
REST UI https://www.drupal.org/project/restui
Contact message REST https://www.drupal.org/project/contact_message_rest
Contact Storage https://www.drupal.org/project/contact_storage
No configuration is needed.

### AUTHOR

Goran Nikolovski
Website: (https://www.gorannikolovski.com)
Drupal: (https://www.drupal.org/u/gnikolovski)
Email: [email protected]
MAINTAINERS
-----------

Company: Studio Present, Subotica, Serbia
Website: (https://www.studiopresent.com)
Drupal: (https://www.drupal.org/studio-present)
Email: [email protected]
Current maintainers:
* Goran Nikolovski (gnikolovski) - https://www.drupal.org/u/gnikolovski
31 changes: 13 additions & 18 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,26 @@
"name": "gnikolovski/druact_api",
"description": "Back-end API for simple decoupled website.",
"type": "drupal-module",
"homepage": "http:https://druact.gorannikolovski.com",
"homepage": "https:https://www.drupal.org/project/druact_api",
"authors": [
{
"name": "Goran Nikolovski",
"email": "nikolovski84@gmail.com",
"homepage": "http:https://gorannikolovski.com",
"email": "goran@gorannikolovski.com",
"homepage": "https:https://gorannikolovski.com",
"role": "Developer"
}
],
"repositories": [
{
"type": "composer",
"url": "https://packages.drupal.org/8"
}
],
"require": {
"drupal/restui": "^1.14",
"drupal/token": "^1.0@rc",
"drupal/contact_message_rest": "^1.0@alpha",
"drupal/contact_storage": "^1.0@beta"
},
"support": {
"issues": "https://github.com/gnikolovski/druact_api/issues",
"email": "nikolovski84@gmail.com"
"issues": "https://www.drupal.org/project/issues/druact_api",
"email": "goran@gorannikolovski.com"
},
"license": "GPL-2.0+",
"minimum-stability": "dev"
"minimum-stability": "dev",
"require": {
"drupal/contact_message_rest": "^1.0@alpha",
"drupal/contact_storage": "^1.1",
"drupal/core": "^8 || ^9",
"drupal/restui": "^1.18",
"drupal/token": "^1.7"
}
}
17 changes: 9 additions & 8 deletions druact_api.info.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
name: Druact API
name: 'Druact API'
type: module
description: 'Back-end API for simple decoupled website.'
core: 8.x
core_version_requirement: ^8 || ^9
dependencies:
- rest
- serialization
- basic_auth
- restui
- token
- contact_message_rest
- contact_storage
- drupal:rest
- drupal:serialization
- drupal:basic_auth
- restui:restui
- token:token
- contact_message_rest:contact_message_rest
- contact_storage:contact_storage
15 changes: 10 additions & 5 deletions druact_api.install
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
<?php

use Drupal\user\RoleInterface;
/**
* @file
* Contains install and update functions for Druact API.
*/

use Drupal\node\Entity\Node;
use Drupal\user\RoleInterface;

/**
* Implements hook_install().
Expand All @@ -14,7 +19,7 @@ function druact_api_install() {
}

/**
* Enable Cross-origin resource sharing (CORS).
* Enables Cross-origin resource sharing (CORS).
*/
function druact_api_enable_cors() {
// Create services.yml file if not exists.
Expand All @@ -37,7 +42,7 @@ function druact_api_enable_cors() {
}

/**
* Grant user permissions for accessing REST endpoints.
* Grants user permissions for accessing REST endpoints.
*/
function druact_api_grant_permissions() {
$permissions = [
Expand All @@ -50,7 +55,7 @@ function druact_api_grant_permissions() {
}

/**
* Create sample articles.
* Creates sample articles.
*/
function druact_api_create_articles() {
$articles = [
Expand Down Expand Up @@ -91,7 +96,7 @@ function druact_api_create_articles() {
}

/**
* Update account settings.
* Updates account settings.
*
* Enable visitors to create accounts and disable email verification.
*/
Expand Down

0 comments on commit 4600729

Please sign in to comment.