Skip to main content

Development Environment

Clone the "Shaper" main library from GitHub https://github.com/brayns-it/shaper

Create a new ASP.NET Project and simply call "InitializeShaper" and "MapShaperApi".

using Brayns.Shaper;

var builder = WebApplication.CreateBuilder(args);
builder.InitializeShaper();

var app = builder.Build();
app.MapShaperApi();

app.Run();

"MapShaperApi" will map two path in your web application:

  • /api to serve REST request with GET, POST, PUT or DELETE method
  • /rpc to serve special JSON request for the client

If you want to use also the web client (not only API) you have to clone "Shaper Web" library from GitHub https://github.com/brayns-it/shaper-web

Simply declare the web client:

using Brayns.Shaper;

var builder = WebApplication.CreateBuilder(args);
builder.InitializeShaper();

var app = builder.Build();
app.MapShaperApi();
app.MapShaperClient();

app.Run();

"MapShaperClient" will catch all requests from "/" base URI and serve the default index.html client page.