API Designer
![Gitter](https://badges.gitter.im/Join Chat.svg)
API Designer is a standalone/embeddable editor for RAML (RESTful API Modeling Language) written in JavaScript using Angular.JS. By default, the editor uses an in-browser filesystem stored in HTML5 Localstorage.
Examples of designing RAML with API Designer in the Wild
API Designer online
There is an online preview version of the API Designer, check it out a different branch.
Running Locally
npm install -g api-designer
api-designer
This will start a local designer instance using the in-browser filesystem.
Embedding
The following example details how to embed the API Designer:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>My App</title>
<link rel="stylesheet" href="styles/api-designer-vendor.css">
<link rel="stylesheet" href="styles/api-designer.css">
</head>
<body ng-app="ramlEditorApp">
<raml-editor></raml-editor>
<script src="scripts/api-designer-parser.js"></script>
<script>
if (window.Worker) {
window.RAML.worker = new Worker('scripts/api-designer-worker.js#parser=./api-designer-parser.js&proxy=/proxy/');
}
</script>
<script src="scripts/api-designer-vendor.js"></script>
<script src="scripts/api-designer.js"></script>
<script>
function myFileSystem($q, config, $rootScope) {
var service = {};
service.directory = function (path) {
var deferred = $q.defer();
$rootScope.$broadcast('event:notification', {message: 'Loading directory' + path, expires: true});
return deferred.promise;
};
service.load = function (path, name) {
var deferred = $q.defer();
return deferred.promise;
};
service.remove = function (path, name) {
var deferred = $q.defer();
return deferred.promise;
};
service.save = function (path, name, contents) {
var deferred = $q.defer();
return deferred.promise;
};
return service;
}
angular.module('ramlEditorApp')
.config(function (fileSystemProvider) {
fileSystemProvider.setFileSystemFactory(myFileSystem);
});
</script>
<style>
html,
body {
height: 100%;
}
</style>
</body>
</html>
Contribution
If you want to contribute to this project, please read our contribution guide first.
License
Copyright 2013 MuleSoft, Inc. Licensed under the Common Public Attribution License (CPAL), Version 1.0