node.config

Here the explanation of -every- part of the node.config.. excluded the security section described on the page dedicated to the security.

Application

This is the name of the application dll. It will be used to initialize the whole server process.

    <Application>NodeCsMusicStore</Application>

Factories

These are the factory that can be overridden to implement custom behaviours. Actually only the ControllersFactory exist. It is used to create the controllers, and could be a custom implementation based, for example, on Castle Windsor

    <Factories>
        <ControllersFactory>Node.Cs.Lib.Controllers.BasicControllersFactory</ControllersFactory>
    </Factories>

Threading

This section defines the specifications of the runtime environment.

<Threading>
    <ThreadNumber>2</ThreadNumber>
    <MaxExecutingRequest>10000</MaxExecutingRequest>
    <MaxConcurrentConnections>1000</MaxConcurrentConnections>
    <MaxMemorySize>200000000</MaxMemorySize>
</Threading>

Debugging

Defines the level of debugging

<Debugging>
    <Debug>true</Debug>
    <DebugAssemblyLoading>true</DebugAssemblyLoading>
</Debugging>

Listener

This configuration will define the configuration of the http listener

<Listener>
    <Port>8081</Port>
    <ServerNameOrIp>*</ServerNameOrIp>
    <ServerProtocol>http</ServerProtocol>
    <SessionTimeout>1200</SessionTimeout>
    <RootDir />
    <Cultures Default="en-US" Available="fr-FR,it-IT"/>
</Listener>

Plugins

The list of dll that will be used as plugins. They can be in any order. They will be loaded at startup and will execute their initializations.

    <Plugins>
        <Plugin Dll="Node.Cs.Admin.dll"/>
        <Plugin Dll="Node.Cs.EntityFramework.dll"/>
        <Plugin Dll="Node.Cs.Razor.dll"/>
    </Plugins>

Handlers

This section defines how the various file types will be handled. For example here i will use the class RazorHandler to handle cshtml files, sayng that the RazorHandler class is inside the Node.Cs.Razor.dll.

Another embedded handlers is the Node.Cs.Lib.Static.StaticHandler. That is used (normally) to handle static files.

<Handlers>
    <Handler Dll="Node.Cs.Razor.dll" ClassName="Node.Cs.Razor.RazorHandler">
        <Extensions>
            <Extension>cshtml</Extension>
        </Extensions>
    </Handler>
</Handlers>

Database

These follows exactly the standard web.config database configuration with the exact same values. Please note that the Provider specified into the connection string is exactly the name specified inside the DbProviderFactory in the InvariantName attribute.

<ConnectionStrings>
    <ConnectionString 
        DataSource="Data Source=...;Initial Catalog=...;Integrated Security=SSPI;AttachDBFilename=..." 
        Name="MusicStoreEntities" 
        Provider="System.Data.SqlClient"/>
</ConnectionStrings>
<DbProviderFactories>
    <Factory 
        InvariantName="System.Data.SqlClient" 
        Type="System.Data.SqlClient.SqlClientFactory, System.Data" />
</DbProviderFactories>

Paths

WebPaths: The web paths are the paths in which is present a root of the file system. The connection string is specific for the various Path provider. If i specify multiple path provider, to find a file to render on the front end, the file will be searched from the last to the first path provider.

The FileSystemPathProvider takes as connection string a relative directory (relative to the node.config location) or an absolute location. Other path providers, for example an hypothetical SqlPathProvider, could require the name of a connection string specified on the database section on the node config.

BinPaths: The paths where all dlls are located, as before they are scanned from last to first to find the missing dlls.

DataDir: The equivalent of the App_Data directory for Asp.NET.

<Paths>
    <WebPaths>
        <PathProvider 
            ClassName="Node.Cs.Lib.PathProviders.FileSystemPathProvider" 
            ConnectionString="">
        </PathProvider>
    </WebPaths>
    <BinPaths>
        <Path>App_Bin</Path>
    </BinPaths>
    <DataDir>App_Data</DataDir>
</Paths>

Last modified on: February 28, 2014