Skip to content

jhedstrom/Drupal-REST-API-starter

Repository files navigation

REST API starter

A simple Drupal 8 install profile that highlights RESTful interactions with Drupal.

Install

  1. Install and initialize.
    $> npm install
    $> grunt
  2. Install the site. Change db url as needed
    $> drush @restapi si --db-url=mysql://restapi:restapi@localhost/restapi -y
  3. Create a user and give them admin (alternatively, configure permissions for another role)
    $> drush ucrt --mail=example@example.com --password=pass mytestuser
    $> drush user-add-role administrator --name=mytestuser
  4. Create content
    $>  curl --include   --request POST   --user mytestuser:pass \
        --header 'Content-type: application/hal+json'   http://restapi.devl/entity/node \
        --data-binary '{"_links":{"type":{"href":"http://restapi.devl/rest/type/node/page"}}, "title":[{"value":"test title"}]}'

About

A simple Drupal 8 install profile that highlights RESTful interactions with Drupal.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published