Code Monkey home page Code Monkey logo

xiufranklin / cocos2d-js-ajax-protobuf-nodejs-springmvc Goto Github PK

View Code? Open in Web Editor NEW

This project forked from whg333/cocos2d-js-ajax-protobuf-nodejs-springmvc

0.0 2.0 0.0 1004 KB

use cocos2d-js/html-ajax to transfer protocol buffers in HTTP with NodeJS/SpringMVC——前端cocos2d-js/html-ajax与后端nodejs/springmvc使用protobuf/json/queryString通信的例子

Home Page: http://www.iclojure.com/blog/articles/2016/04/29/cocos2d-js-ajax-protobuf-nodejs-java

JavaScript 90.27% Java 4.37% Batchfile 0.02% Shell 1.20% CMake 2.36% HTML 1.74% Protocol Buffer 0.04%

cocos2d-js-ajax-protobuf-nodejs-springmvc's Introduction

cocos2d-js-ajax-protobuf-nodejs-springmvc

This example shows how to use cocos2d-js/html-ajax to transfer protocol buffers/json/queryString in HTTP with NodeJS/SpringMVC

Instructions for NodeJS

  1. Set up dependencies: npm install
  2. Copy the cocos2d-js frameworks to cocos2d-js directory
  3. Run: node server.js
  4. Open http://localhost:3000 in a recent browser

Instructions for Java/SpringMVC

  1. Import project to your Eclipse
  2. Convert to Maven Project
  3. Run on Server (jetty or tomcat), make sure your server context path is / and port is 3000
  4. Open http://localhost:3000 in a recent browser

Snapshots

below is the TestProtobuf.proto

package TestProtobuf;

option java_package = "com.why.game.protobuf";
option java_outer_classname = "TestProtobuf";

message TestProto{
	optional int32 id = 1;
	optional string name = 2;
}

you will see below Snapshots when you visit http://localhost:3000

1

you can click the link to visit Cocos2d-JS-Protobuf or Html-Ajax-Protobuf as below

2

in the Html-Ajax-Protobuf page you can choose protocol to see how the NodeJS and Java/SpringMVC process protobuf/json/queryString

6

cocos2d-js-ajax-protobuf-nodejs-springmvc's People

Contributors

whg333 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.