templates.plugins.spincast-config.spincast-config.html Maven / Gradle / Ivy
Show all versions of spincast-website Show documentation
{#==========================================
Spincast Config plugin
==========================================#}
{% extends "../../layout.html" %}
{% block sectionClasses %}plugins plugins-spincast-config{% endblock %}
{% block meta_title %}Plugins - Spincast Config{% endblock %}
{% block meta_description %}Spincast Config plugin provides the default configurations required by Spincast.{% endblock %}
{% block scripts %}
{% endblock %}
{% block body %}
Overview
The Spincast Config plugin provides an implementation
of the ISpincastConfig interface to provide default
values to the configurations required by Spincast.
The current implementation is very simple: the values are simply hardcoded.
Installation
If you use the spincast-default artifact, this plugin is already installed so
you have nothing more to do!
If you start from scratch using the spincast-core artifact, you can use the
plugin by adding this artifact to your project:
<dependency>
<groupId>org.spincast</groupId>
<artifactId>spincast-plugins-config</artifactId>
<version>{{spincastCurrrentVersion}}</version>
</dependency>
You then install the plugin's Guice module, by passing it to the Guice.createInjector(...) method:
Injector guice = Guice.createInjector(
new SpincastCoreGuiceModule(args),
new SpincastConfigPluginGuiceModule(IAppRequestContext.class, IAppWebsocketContext.class)
// other modules...
);
... or by using the install(...) method from your custom Guice module:
public class AppModule extends SpincastCoreGuiceModule {
@Override
protected void configure() {
super.configure();
install(new SpincastConfigPluginGuiceModule(getRequestContextType(),
getWebsocketContextType()));
// other modules...
}
// ...
}
The ISpincastConfig interface
Methods :
-
boolean isDebugEnabled()
Let this to true on development environment,
where errors can be publicly displayed, where cache can
be disabled, etc. In production set it to false
The default value is true.
-
String getServerHost()
The host/IP on which the server will listen to.
The default value is 0.0.0.0.
-
int getHttpServerPort()
The HTTP (unsecure) port on which the server will listen on.
If <= 0, it won't be used.
The default value is 44419 so HTTP
is enabled by default.
-
int getHttpsServerPort()
The HTTPS (secure) port on which the server will listen on.
If <= 0, it won't be used.
The default value is -1 so HTTPS
is not enabled by default.
-
String getHttpsKeyStorePath()
The path to the KeyStore, for SSL. Can be a
classpath path or and absolute path.
The classpath will be checked first.
Only used if getHttpsServerPort() returns a port > 0.
The default value is null.
-
String getHttpsKeyStoreType()
The type of the KeyStore, for SSL.
For example: "JKS".
Only used if getHttpsServerPort() returns a port > 0.
The default value is null.
-
String getHttpsKeyStoreStorePass()
The "storepass" of the KeyStore, for SSL.
Only used if getHttpsServerPort() returns a port > 0.
The default value is null.
-
String getHttpsKeyStoreKeypass()
The "keypass" of the KeyStore, for SSL.
Only used if getHttpsServerPort() returns a port > 0.
The default value is null.
-
boolean isRoutesCaseSensitive()
Are the URLS case-sensitive or not, during the route matching
process?
The default value is false.
-
String getEnvironmentName()
Returns the name of the environment.
The default value is local.
-
long getServerMaxRequestBodyBytes()
Maximum number of bytes a request's body can have.
"-1" means no limit.
The default value is 104857600 (100MB).
-
List<String> getContentTypesToSkipGziping()
Even if gziping of the response is enabled, those Content-Types
still won't be gzipped.
If an entry ends with "*", it will be considered as a prefix
(ex: "image/*" will match all Content-Types starting with "image/").
Otherwise, the current response Content-Type will have to exactly
match the entry (case insensitive), or being followed by a " " or
a ";".
-
File getSpincastWritableDir()
A directory where generated files and temporary files
can be written by Spincast.
The default value uses System.getProperty("java.io.tmpdir")
to create a temporary directory.
-
Locale getDefaultLocale()
The default Locale to use if no other Locale can be found
as a "best match", for the current request.
The default value is Locale.US.
-
int getRouteForwardingMaxNumber()
The maximum number of time a request can be forwarded to another
route. After this number, an exception will be thrown.
The default value is 2.
{% endblock %} 

Spincast Config