Exemplo n.º 1
0
        /// <summary>
        /// Add a RESTServer to the RESTCluster
        /// </summary>
        public void Add(string label, RESTServer server)
        {
            if (this._started)
            {
                server.Start();
            }

            this._servers.Add(label, server);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Construction loads all routes found in the project's DLLs.
        /// </summary>
        internal RouteCache(RESTServer server, string baseUrl, bool autoLoadResources)
        {
            _routes = new List <Entry>();

            if (autoLoadResources)
            {
                foreach (RESTResource resource in LoadRestResources(baseUrl))
                {
                    resource.Server = server;
                    this.Add(resource);
                }

                SortRoutes();
            }
        }