Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

New GitHub Integration Offers Direct Import into DreamFactory

DZone's Guide to

New GitHub Integration Offers Direct Import into DreamFactory

Have you ever wanted to learn how to load script files from GitHub directly into the admin app? You've come to the right place.

Free Resource

Share, secure, distribute, control, and monetize your APIs with the platform built with performance, time-to-value, and growth in mind. Free 90 day trial 3Scale by Red Hat

One of my favorite features in DreamFactory is server-side scripting. Both event scripts and script services can really extend the DreamFactory platform and customize it to your needs. If you are not familiar with DreamFactory server-side scripting, I recommend visiting the scripting documentation.

Previously, you had two ways of adding or updating your scripts in DreamFactory. You could either use the built-in code editor or you could upload your script files. If you use your own scripts in production, you typically want to use some type of source code version control, like GitHub, which adds another step to the process: checking out your script file from GitHub.

With the DreamFactory 2.3.1 release, we made loading a GitHub file a lot easier. You can now load script files from GitHub directly from the DreamFactory admin app.

Here's how:

1. Go to the Scripts Page

Select the event for which you want to create or edit a script. In this example, this is the files that GET pre-processes. In the form where you select Script Type/Language, there’s a new button in the Upload a script file section that allows you to select a file from GitHub.

2. Click the Select File… Button

A dialog will appear. Either type in the script file’s GitHub URL or paste it into the field. If the script file is in a public folder, just click the Upload button and the script will be inserted into the code editor. Make your selections and click the Save button. If the script file is in a private folder, you will be asked to provide your GitHub username and password for the selected repo. Your GitHub username and password will not be stored by DreamFactory, and you will need to provide your GitHub credentials every time you load script files from a private GitHub repo.

Scripting console

Add a GitHub URL

Authenticate to access the GitHub repository

 

And that’s it!

This feature is easy to use and provides a convenient way to source control your scripts in GitHub. The feature is also implemented for script services, and it works the same way there. Select the Services page > Create service > select Script in the dropdown and the language of your choice. Script files can be uploaded from GitHub in both the Config and the Service Definition tabs.

Discover how you can achielve enterpriese agility with microservices and API management

Topics:
github ,dreamfactory ,integration ,scripts

Published at DZone with permission of Carsten Jacobsen, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}