For comprehensive information about FlexiCore Boot Starter Web please visit our site.
FlexiCore Boot Starter Web is a FlexiCore Module that enables Spring's RestController inside FlexiCore Plugins.
Add the flexicore-boot-starter-web dependency using the latest version available from maven central:
<dependency>
<groupId>com.wizzdi</groupId>
<artifactId>flexicore-boot-starter-web</artifactId>
<version>LATEST</version>
</dependency>
Simply annotate your application class or your configuration class with
@EnableFlexiCoreRESTPlugins
your application class:
@EnableFlexiCorePlugins
@EnableFlexiCoreRESTPlugins
@SpringBootApplication
public class App {
public static void main(String[] args) {
SpringApplication app = new SpringApplication(App.class);
app.addListeners(new ApplicationPidFileWriter());
ConfigurableApplicationContext context=app.run(args);
}
}
a RestController inside a plugin:
@Extension
@RestController
public class PluginAService implements Plugin {
@GetMapping("/test")
public String createTestEntity(@RequestParam(name="name", required=false, defaultValue="Stranger") String name) {
return "hello "+name;
}
}
FlexiCore Boot Starter Web exposes the following configuration options:
name | default value | description |
---|---|---|
flexicore.externalStatic | /home/flexicore/ui/ | location of ui |
flexicore.externalStaticMapping | /** | mapping of ui |
flexicore.internalStaticLocation | classpath:/static/ | location of internally provided ui |
flexicore.internalStaticMapping | /FlexiCore/** | mapping of internally provided ui |