Tutorial by Examples: configuration

After the install of an IoC (Inversion of Control) container, some tweaks are needed to make it work. In this case, I'll use Ninject. In the NinjectWebCommon file, that is located in the App_Start folder, substitute the CreateKernel method with: private static IKernel CreateKernel() { ...
To set up Node remote debugging, simply run the node process with the --debug flag. You can add a port on which the debugger should run using --debug=<port>. When your node process starts up you should see the message Debugger listening on port <port> Which will tell you that everyt...
Make sure that the NodeJS plugin is enabled Select your run configurations (screen) Select + > Node.js Remote Debug Make sure you enter the port selected above as well as the correct host Once those are configured simply run the debug target as you normally would and it will...
First, we need a custom endpoint builder. public class WSConfigurator extends ServerEndpointConfig.Configurator { @Inject private static Injector injector; @Override public <T> T getEndpointInstance(Class<T> endpointClass) throws InstantiationException { ...
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> ...
Here is the corresponding Java configuration: Add this annotation to an @Configuration class to have the Spring Security configuration defined in any WebSecurityConfigurer or more likely by extending the WebSecurityConfigurerAdapter base class and overriding individual methods: @Configuration @En...
Large scale applications often need different properties when running on different environments. we can achieve this by passing arguments to NodeJs application and using same argument in node process to load specific environment property file. Suppose we have two property files for different enviro...
Usage To install a module (assuming cpanm is already installed): cpanm Data::Section cpanm ("cpanminus") strives to be less verbose than cpan but still captures all of the installation information in a log file in case it is needed. It also handles many "interactive questions&quo...
Configuration Log4j configuration file can be in any of these formats: JSON YAML properties (text file) XML Configuration discovery Log4j will inspect the log4j.configurationFile system property and, if set, will attempt to load the configuration. If no system property is set log4j wil...
The advantage of using Apache over the builtin werkzeug server is that Apache is multi-threaded, meaning that multiple connections to the application can be made simultaneously. This is especially useful in applications that make use of XmlHttpRequest (AJAX) on the front-end. /etc/apache2/sites-ava...
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="locations"> <list> <value>classpath:ReleaseBundle.properties</value> </list> </bean>
There are very good configurations to force typings and get more helpful errors which are not activated by default. { "compilerOptions": { "alwaysStrict": true, // Parse in strict mode and emit "use strict" for each source file. // If you have wrong c...
You can configure the database settings in config/connections.js. Example: someMongoDb: { adapter: 'sails-mongo', host: 'localhost', // defaults to `localhost` if omitted port: 27017, // defaults to 27017 if omitted user: 'username_here', // or omit if not relevant password: 'passwo...
Step one We need to create a service called jwToken. Go to api/services directory and create jwToken.js. 'use strict'; const jwt = require('jsonwebtoken'), tokenSecret = "secretissecret"; module.exports = { // Generates a token from supplied payload issue(payload) { ...
CELERY Installation - pip install django-celery Add Basic project structure. - src/ - bin/celery_worker_start # will be explained later on - logs/celery_worker.log - stack/__init __.py - stack/celery.py - stack/settings.py - stack/urls.py - manage.py ...
Castle enables to register components also via XML Registration. //To install from the app/web.config container.Install(Configuration.FromAppConfig()); //To install from an xml file Configuration.FromXmlFile("relative_path_to_file.xml"); Read Castle's documentation for "What ...
Inside a Project configuration, you can Create build configuration: Manually Provide a Name and a Description. The Build Configuration ID is generated from the ProjectName, and the Build Configuration Name's. Once your configuraion is Saved, you can specify a Version Control Settings. This will ...
Consider the following Java classes: class Foo { private Bar bar; public void foo() { bar.baz(); } } As can be seen, the class Foo needs to call the method baz on an instance of another class Bar for its method foo to work successfully. Bar is said to be a dependency for Foo sin...
The same examples as shown above with XML configuration can be re-written with Java configuration as follows. Constructor injection @Configuration class AppConfig { @Bean public Bar bar() { return new Bar(); } @Bean public Foo foo() { return new Foo(bar()); } } Property in...
Dependencies can be autowired when using the component scan feature of the Spring framework. For autowiring to work, the following XML configuration must be made: <context:annotation-config/> <context:component-scan base-package="[base package]"/> where, base-package is th...

Page 5 of 8