diff --git a/README.md b/README.md index f6cd031..570c63f 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,26 @@ Documentation for how to operate and how to customize your server are coming soo ## Dev Documentation For development see [api.md](doc/api.md) and [contribute.md](doc/contribute.md) +## Using as a lib + +Flying-squid is also a server lib. Here is a basic example of usage : + +```js +var mcServer=require("flying-squid"); + +mcServer.createMCServer({ + motd: "Basic craftyjs server", + 'max-players': 10, + port: 25565, + 'online-mode': true, + gameMode:0, + commands: {}, + logging:false +}); +``` + +You can add server plugins and player plugins in your package, following [contribute.md](doc/contribute.md). + ## Contributors - @roblabla for helping out with the protocols diff --git a/examples/basic.js b/examples/basic.js new file mode 100644 index 0000000..14dbb97 --- /dev/null +++ b/examples/basic.js @@ -0,0 +1,11 @@ +var mcServer=require(".."); + +mcServer.createMCServer({ + motd: "Basic craftyjs server", + 'max-players': 10, + port: 25565, + 'online-mode': true, + gameMode:0, + commands: {}, + logging:false +}); \ No newline at end of file