Created
April 6, 2017 04:20
-
-
Save SynapseProject/0f345c4fa60cdb53ae8d3585cde24513 to your computer and use it in GitHub Desktop.
Created a custom ApiControllers with Synapse.Server.Extensibility
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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