Skip to content

Instantly share code, notes, and snippets.

@SynapseProject
Created April 6, 2017 04:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SynapseProject/0f345c4fa60cdb53ae8d3585cde24513 to your computer and use it in GitHub Desktop.
Save SynapseProject/0f345c4fa60cdb53ae8d3585cde24513 to your computer and use it in GitHub Desktop.
Created a custom ApiControllers with Synapse.Server.Extensibility
using System;
using System.Web.Http;
using Synapse.Services;
/// <summary>
/// Create a new Class Library (dll) project
/// Add a ref to Synapse.Services.Extensibility from: https://www.nuget.org/packages/Synapse.Server.Extensibility
/// </summary>
namespace Synapse.Custom
{
[RoutePrefix( "custom" )]
public class CustomController : ApiController
{
[HttpGet]
[Route( "hello" )]
public string Hello()
{
return "Hello from CustomController, World!";
}
[HttpGet]
[Route( "synapse" )]
public string SynapseHello()
{
IExecuteController ec = ExtensibilityUtility.GetExecuteControllerInstance();
return ec.Hello();
}
}
}
# Configure the 'Assemblies' node of Synapse.Server.config.yaml
ServiceName: Synapse.Controller
ServiceDisplayName: Synapse Controller
ServerRole: Controller
WebApiPort: 20000
AuthenticationScheme: IntegratedWindowsAuthentication
SignatureKeyFile:
SignatureKeyContainerName: DefaultContainerName
SignatureCspProviderFlags: NoFlags
Controller:
NodeUrl: http://localhost:20001/synapse/node
SignPlan: false
Assemblies:
- Synapse.CustomController
Dal:
Type: Synapse.Controller.Dal.FileSystem:FileSystemDal
Config:
PlanFolderPath: Plans
HistoryFolderPath: History
ProcessPlansOnSingleton: false
ProcessActionsOnSingleton: true
Security:
FilePath: Security
IsRequired: true
GlobalExternalGroupsCsv: Everyone
LdapRoot:
Node:
MaxServerThreads: 0
AuditLogRootPath: .\Logs
Log4NetConversionPattern: '%d{ISO8601}|%-5p|(%t)|%m%n'
SerializeResultPlan: true
ValidatePlanSignature: false
ControllerUrl: http://localhost:20000/synapse/execute
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment