Skip to content
This repository was archived by the owner on Oct 10, 2026. It is now read-only.

Commit 13776b2

Browse files
committed
Update README.md
1 parent 9994465 commit 13776b2

1 file changed

Lines changed: 37 additions & 0 deletions

File tree

‎WebApplication/README.md‎

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,45 @@ There are different files to configure the application:
7272
###server/app/config/database.json:
7373
this file contains the configuration params to connect with the database, hosted in <a target="_blank" href="https://mongolab.com/welcome/">https://mongolab.com/welcome/</a></li>
7474

75+
###server/app/config/managers.json:
76+
this file maps the different websocket event keys to the correct manager.
77+
7578
##Running the server
7679

7780
To run the server, you must go to the server path and run the server.js with node
7881

7982
node server.js
83+
84+
But... Wait a minute! Where I configure my websocket connection? I forgot it! No problem, you only need to go to your package.json in your client path, and set your host and port in the wsServer property. For example:
85+
86+
"wsServer" : "ws://localhost:8888"
87+
88+
Then you will need to run grunt command again. But... how my connection javascript module knows that needs to get this value from the package.json file? It is simple. In the client/js/common/services/socketioConnection.js you have this line:
89+
90+
connection = io.connect('<%= pkg.wsServer %>')
91+
92+
Yes! When you run grunt, you coult treat the javascript files as templates, setting the proccess property to true, for example in the concat configuration plugin:
93+
94+
concat : {
95+
options: {
96+
separator: "\n",
97+
process : true //treating js files as templates!
98+
},
99+
dist : {
100+
files: [
101+
{
102+
src : [
103+
"js/common/**/*.js",
104+
"js/app.js",
105+
"js/app/**/*.js"
106+
],
107+
dest: "build/<%= pkg.name %>.js"
108+
}
109+
]
110+
}
111+
}
112+
113+
This is another interesting trick with grunt.
114+
115+
And it is all! You are runnning your server and you could go to your favourite web browser and run the applicacion typing http://application_host:application_port! I am sorry, it is not work on IE < 10... ups! I told you your FAVOURITE web browser!! I do not think you test it on IE<10 ;)
116+

0 commit comments

Comments
 (0)