Skip to content
This repository was archived by the owner on Sep 25, 2023. It is now read-only.

Quick start guide

lwj edited this page Oct 24, 2012 · 60 revisions

Pomelo is a high-performance framework for node.js. Through some simple command, it can help you for avoid boring rehanding and underlying logic.

Installation

Install pomelo by npm(node package manager):

npm install pomelo -g

Also you can down the source code by the command of git clone https://github.com/NetEase/pomelo.git.

Usage

Create new project

Both the command "pomelo init ./helloWorld" and "mkdir helloWorld && cd helloWorld && pomelo init ." can created a new project. The first one will automatically mkdir helloWorld directory and init it. At last, the dependencies should be installed by command "sh npm-install.sh"

A new project is made up of many folders as follows:

directory structure

The directory structure corresponds to the game logic, and you can fill code in related directory.

More infomation about this directory:

game-server

Game-server made of pomelo contains all of the game logic and components. In practical work, all code about game logic and components should be fill here.

config

Generally, a project needs a lot of configurations and you can finish them by JSON file here. In the game project, some configurations have be created such as log, master-server and other servers at initialization. Also, you can add database, map and numerical tabular etc.

logs

Logs which are essential for the project contains a number of infomation, you can get the project status by them.

shared

Both some configurations and code resources can be shared between front end and back end if you choose javascript to run client.

web-server

Web server made of express receives player's requests.

Clone this wiki locally