Fork me on GitHub

This creates a simple web app for Drupal 7.

1. Create an app folder

Next, create a folder called app to store your application's source code. This folder should live within the same domain as your Drupal website. For example, place it in a new directory called app in your Drupal root:

2. Download jDrupal

Download the tool kit so it lives here:

3. Add an index.html file

Next, create an index.html file to start your app.

<!DOCTYPE html>


      <script src="jdrupal.min.js"></script>
      <script src="app.js"></script>


  <body onload="hello_world()">
    <p id="msg">Loading...</p>

4. Add an app.js file

Next, create an app.js file to run your app and replace the sitePath value with the URL to your Drupal website.

Drupal.settings.site_path = "";
Drupal.settings.endpoint = "rest";
function hello_world() {
    success: function(result) {
      // Prepare a message for the user.
      var text = Drupal.user.uid == 0 ?
        'Hello World' : 'Hello ' +;
      // Show the message in the paragraph.
      document.getElementById("msg").innerHTML = text;

5. Run the app

Navigate to to view the Hello World.