CradleServer
This is the API Documentation for the Cradle module. It contains all the API functions for the server.
local Cradle = require(game:GetService("ReplicatedStorage").Cradle)
Properties
RemoteComm
CradleServer.RemoteComm:  tableContains the Remote Communication Module.
tip
See the Networking guide to learn more about it.
Component
CradleServer.Component:  tableContains the Component Module.
tip
See the Components guide to learn more about it.
Modules
CradleServer.Modules:  tableContains all modules in the Modules folder.
Shared
CradleServer.Shared:  tableContains all modules that is stored in the Modules Folder.
Packages
CradleServer.Packages:  tableContains all modules in the Packages folder.
Util
This was deprecated in v1.0.0
This item is deprecated. Do not use it for new work.
CradleServer.Util:  tableContains all modules in the Packages folder.
Functions
RegisterMiddleware
CradleServer:RegisterMiddleware(priority: number,function: func,services: table?) → nilRegisters a middleware function to be called before a service's remote object is invoked.
caution
This will only run when the server has received a request from the client.
Usage
CradleServer:RegisterMiddleware(1, function()
	print("This is a middleware function")
end, {
	Cradle:GetService("SomeService"),
	Cradle:GetService("AnotherService"),
})
CreateService
CradleServer:CreateService(Name: string,Client: table) → ServiceCreates a new service.
caution
Services must be created before calling Cradle:Start()
Usage
local SomeService = Cradle:CreateService({
	Name = "SomeService",
	Client = {},
})
function SomeService.Client:SomeRemoteFunction()
	print("SomeService has been called!")
	return "Hello from the server!"
end
function SomeService:Init()
	print("SomeService has been initialised!")
end
function SomeService:Start()
	print("SomeService has started!")
end
GetService
CradleServer:GetService(serviceName: string) → ServiceGets a service by name. Throws a warning if the service is not found.
Load
CradleServer:Load() → nilLoads all services and components.
caution
This must be called before calling Cradle:Start()
Start
CradleServer:Start() → nilStarts all services and components.
caution
This must be called after calling Cradle:Load()