Browse Source

renamed to webframe

master
mortie 7 years ago
parent
commit
3b1f88ac11
3 changed files with 7 additions and 11 deletions
  1. 1
    5
      README.md
  2. 4
    4
      index.js
  3. 2
    2
      package.json

+ 1
- 5
README.md View File

# Webby
# webframe


Web server. Web server.

## Usage



+ 4
- 4
index.js View File

this.res404 = options.res404 || res404; this.res404 = options.res404 || res404;
this.res403 = options.res403 || res403; this.res403 = options.res403 || res403;


// Script to be served as /webby.js
// Script to be served as /webframe.js
this.clientScript = ""; this.clientScript = "";


// Create server // Create server
fs.readFileSync(__dirname+"/client/utils.js", "utf8")); fs.readFileSync(__dirname+"/client/utils.js", "utf8"));
} }


// Serve /webby.js
this.get("/webby.js", (req, res) => {
// Serve /webframe.js
this.get("/webframe.js", (req, res) => {
res.writeHead(200, { res.writeHead(200, {
"Content-Type": "application/javascript" "Content-Type": "application/javascript"
}); });
} }


/* /*
* Add code to be served as /webby.js
* Add code to be served as /webframe.js
*/ */
addScript(name, str) { addScript(name, str) {
var start = "(function "+name+"() {\n"; var start = "(function "+name+"() {\n";

+ 2
- 2
package.json View File

{ {
"name": "webby",
"name": "webframe",
"version": "0.1.0", "version": "0.1.0",
"description": "Web server.", "description": "Web server.",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"test": "echo \"Error: no test specified\" && exit 1" "test": "echo \"Error: no test specified\" && exit 1"
}, },
"author": "Martin Dørum Nygaard <martid0311@gmail.com> (http://mort.coffee)",
"author": "Martin Dørum <martid0311@gmail.com> (http://mort.coffee)",
"license": "ISC" "license": "ISC"
} }

Loading…
Cancel
Save