Skip to content

Commit

Permalink
Update README and some tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
nelson.silva committed May 23, 2012
1 parent 25c8949 commit e1136b9
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 23 deletions.
26 changes: 26 additions & 0 deletions README.md
Expand Up @@ -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.
2 changes: 1 addition & 1 deletion bin/node.vertx
@@ -1,2 +1,2 @@
#!/bin/sh
vertx run
vertx run node.vert.x -conf vertx.json
2 changes: 1 addition & 1 deletion build.properties.sample
@@ -1 +1 @@
vertx.dir=../vert.x/target/dist-build/vert.x-1.0.final/
vertx.dir=../../
16 changes: 0 additions & 16 deletions 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;
Expand Down Expand Up @@ -185,16 +182,6 @@ protected ModuleSource loadFromFallbackLocations(String moduleId, Object validat
return loadNodeModules(moduleId);
}

@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
Expand All @@ -203,9 +190,6 @@ protected ModuleSource loadFromUri(URI uri, URI base, Object validator)
File file = new File(uri);
String moduleId = file.getName();

if(moduleId.equals("sockjs")){
int i = 1;
}
if(base == null)
base = file.getParentFile().toURI().resolve("");

Expand Down
5 changes: 4 additions & 1 deletion 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;
Expand Down
5 changes: 1 addition & 4 deletions src/org/vertx/node/NodeVerticle.java
Expand Up @@ -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 {

Expand Down

0 comments on commit e1136b9

Please sign in to comment.