Browse files

Update README and some tweaks

  • Loading branch information...
1 parent 25c8949 commit e1136b9418132db0c46a67321e277a9896a7509a @nelsonsilva committed May 23, 2012
View
26 README.md
@@ -2,4 +2,30 @@
This is a simple node.js compatibility layer for [vert.x](http://vertx.io)
+## Building
+
+Clone the repo into your vertx/mods directory
+
+Copy build.properties.sample to build.properties
+
+`ant`
+
+## Running
+
+Go to your project directory (ex: ShareJS)
+
+Create a configuration file, ex (vertx.json) :
+
+`
+{
+ "main": "bin/exampleserver"
+}
+`
+
+Run the node.vert.x mod and pass it the conf file:
+
+`vertx run node.vert.x -conf vertx.json`
+
+## Notes
+
All the node.js modules are copied from [node.js](https://github.com/joyent/node) which means copyright Joyent, Inc. and other Node contributors.
View
2 bin/node.vertx
@@ -1,2 +1,2 @@
#!/bin/sh
-vertx run
+vertx run node.vert.x -conf vertx.json
View
2 build.properties.sample
@@ -1 +1 @@
-vertx.dir=../vert.x/target/dist-build/vert.x-1.0.final/
+vertx.dir=../../
View
16 src/org/vertx/node/NodeModuleSourceProvider.java
@@ -1,10 +1,7 @@
package org.vertx.node;
-import org.mozilla.javascript.Scriptable;
import org.mozilla.javascript.commonjs.module.ModuleScope;
import org.mozilla.javascript.commonjs.module.provider.ModuleSource;
-import org.mozilla.javascript.commonjs.module.provider.ModuleSourceProvider;
-import org.mozilla.javascript.commonjs.module.provider.ModuleSourceProviderBase;
import org.mozilla.javascript.commonjs.module.provider.UrlModuleSourceProvider;
import org.vertx.java.core.json.DecodeException;
import org.vertx.java.core.json.JsonObject;
@@ -186,26 +183,13 @@ protected ModuleSource loadFromFallbackLocations(String moduleId, Object validat
}
@Override
- public ModuleSource loadSource(URI uri, Object validator) throws IOException, URISyntaxException {
- return super.loadSource(uri, validator); //To change body of overridden methods use File | Settings | File Templates.
- }
-
- @Override
- public ModuleSource loadSource(String moduleId, Scriptable paths, Object validator) throws IOException, URISyntaxException {
- return super.loadSource(moduleId, paths, validator); //To change body of overridden methods use File | Settings | File Templates.
- }
-
- @Override
protected ModuleSource loadFromUri(URI uri, URI base, Object validator)
throws IOException, URISyntaxException
{
File file = new File(uri);
String moduleId = file.getName();
- if(moduleId.equals("sockjs")){
- int i = 1;
- }
if(base == null)
base = file.getParentFile().toURI().resolve("");
View
5 src/org/vertx/node/NodeRequire.java
@@ -1,6 +1,9 @@
package org.vertx.node;
-import org.mozilla.javascript.*;
+
+import org.mozilla.javascript.Context;
+import org.mozilla.javascript.Script;
+import org.mozilla.javascript.Scriptable;
import org.mozilla.javascript.commonjs.module.ModuleScope;
import org.mozilla.javascript.commonjs.module.ModuleScriptProvider;
import org.mozilla.javascript.commonjs.module.provider.SoftCachingModuleScriptProvider;
View
5 src/org/vertx/node/NodeVerticle.java
@@ -18,17 +18,14 @@
import org.mozilla.javascript.*;
import org.mozilla.javascript.commonjs.module.Require;
-import org.mozilla.javascript.commonjs.module.RequireBuilder;
-import org.mozilla.javascript.commonjs.module.provider.SoftCachingModuleScriptProvider;
import org.vertx.java.core.json.JsonObject;
import org.vertx.java.core.logging.Logger;
-import org.vertx.java.core.logging.impl.LoggerFactory;
import org.vertx.java.deploy.Verticle;
import java.io.*;
/**
- * @author <a href="http://tfox.org">Tim Fox</a>
+ * @author <a href="http://about.me/nelson.silva">Nelson Silva</a>
*/
public class NodeVerticle extends Verticle {

0 comments on commit e1136b9

Please sign in to comment.