{"_id":"mold","_rev":"90-a5b4657a27229fd42cdc856a24d471f4","name":"mold","description":"Web Framework","dist-tags":{"latest":"0.0.11"},"versions":{"0.0.1":{"name":"mold","description":"Web Framework","version":"0.0.1","author":{"name":"Kenneth Koontz","email":"kenneth.koontz@gmail.com"},"bin":{"mold":"./mold.js"},"preferGLobal":"true","dependencies":{"commander":"0.5.2","colors":"0.6.0","walk":"*"},"_npmUser":{"name":"kenneth.koontz","email":"kenneth.koontz@gmail.com"},"_id":"mold@0.0.1","scripts":{"start":"node server.js"},"devDependencies":{},"optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.9","_nodeVersion":"v0.6.13","_defaultsLoaded":true,"dist":{"shasum":"d5563323671ff1961e61afff3459ad95c99c9fca","tarball":"https://registry.npmjs.org/mold/-/mold-0.0.1.tgz","integrity":"sha512-Cz4UFFYU3V4JYrSGcrUeD12q4KF0jWCE/2f2kKE2AWtD75c/HjBC3QCN51xVJ2sPH84SLzZ27lFo/kVhaypvGQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH8iWcRMBMjl7xcOsADU77eqvLeFe6SHbaGloFWn+UK0AiBWnHPA9IBEnN5ymjT9qcZ9V0wdto9j6uE7eRwkn+ObaA=="}]},"maintainers":[{"name":"kenneth.koontz","email":"kenneth.koontz@gmail.com"}],"directories":{}},"0.0.2":{"name":"mold","description":"Web Framework","version":"0.0.2","author":{"name":"Kenneth Koontz","email":"kenneth.koontz@gmail.com"},"bin":{"mold":"./mold.js"},"preferGLobal":"true","dependencies":{"commander":"0.5.2","colors":"0.6.0","walk":"*"},"_npmUser":{"name":"kenneth.koontz","email":"kenneth.koontz@gmail.com"},"_id":"mold@0.0.2","scripts":{"start":"node server.js"},"devDependencies":{},"optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.9","_nodeVersion":"v0.6.13","_defaultsLoaded":true,"dist":{"shasum":"5c49c3d788d1cece0372b4d53a75c67c331d6aa9","tarball":"https://registry.npmjs.org/mold/-/mold-0.0.2.tgz","integrity":"sha512-Gd7M5SipBt8YpV6I5Sr3hFxUfyOHdTPjPqQFXK8zqII63keCU0jXHRgUMelsAvX/YXDgcHol9JqajOwM+5us9A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGm8NtchWsqOGME1G/FQsWPq6HNcNy47zOLOObhMXD4HAiEAnZhYCFJNDkAzsPrd5cthPy1cApHktasnqBc5XlKYIek="}]},"maintainers":[{"name":"kenneth.koontz","email":"kenneth.koontz@gmail.com"}],"directories":{}},"0.0.3":{"name":"mold","description":"Web Framework","version":"0.0.3","author":{"name":"Kenneth Koontz","email":"kenneth.koontz@gmail.com"},"bin":{"mold":"./mold.js"},"preferGLobal":"true","dependencies":{"commander":"0.5.2","colors":"0.6.0"},"_npmUser":{"name":"kenneth.koontz","email":"kenneth.koontz@gmail.com"},"_id":"mold@0.0.3","scripts":{"start":"node server.js"},"devDependencies":{},"optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.9","_nodeVersion":"v0.6.13","_defaultsLoaded":true,"dist":{"shasum":"3398bacf83653ec943b476529f9cb2c7f6d53f9e","tarball":"https://registry.npmjs.org/mold/-/mold-0.0.3.tgz","integrity":"sha512-ocOA+yzL6mFnlgiIZu8MHsFGFe0KdDoYb2xS7tWPMaopvpx5zXCGJU2WAtyuhWD1UmUqM9cTpah39cdEt0wXig==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBS7JsGqZIgjgZ2PtHAirIHWM7iQwTVNn6P2q8RgX5yqAiEA8A6XeacC9h+hV29LkjM9Fq57b+2JszJgPJceEJD8Q7w="}]},"maintainers":[{"name":"kenneth.koontz","email":"kenneth.koontz@gmail.com"}],"directories":{}},"0.0.5":{"name":"mold","description":"Web Framework","version":"0.0.5","author":{"name":"Kenneth Koontz","email":"kenneth.koontz@gmail.com"},"bin":{"mold":"./mold.js"},"preferGLobal":"true","dependencies":{"commander":"0.5.2","colors":"0.6.0"},"_npmUser":{"name":"kenneth.koontz","email":"kenneth.koontz@gmail.com"},"_id":"mold@0.0.5","scripts":{"start":"node server.js"},"devDependencies":{},"optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.9","_nodeVersion":"v0.6.13","_defaultsLoaded":true,"dist":{"shasum":"7a17cf233fb79e707affc32cfb1e7124c335977c","tarball":"https://registry.npmjs.org/mold/-/mold-0.0.5.tgz","integrity":"sha512-YCQvPKZz1925ZQ167KbAr1h3VZ33/ubAQWdaWB0raDnPmuNUuKLE2XbzvQoKo7Q8ezmjO5yORzYQuOXhihVgHg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCioj0kUcnfdBiWkYwYS5AFgRmMs0sdeNiAMsIsF8gMqwIgeVtaEwKnwMQ7Op0MVVznlvmqJek7jwJ7L6AiynrROKU="}]},"maintainers":[{"name":"kenneth.koontz","email":"kenneth.koontz@gmail.com"}],"directories":{}},"0.0.4":{"name":"mold","description":"Web Framework","version":"0.0.4","author":{"name":"Kenneth Koontz","email":"kenneth.koontz@gmail.com"},"bin":{"mold":"./mold.js"},"preferGLobal":"true","dependencies":{"commander":"0.5.2","colors":"0.6.0"},"_npmUser":{"name":"kenneth.koontz","email":"kenneth.koontz@gmail.com"},"_id":"mold@0.0.4","scripts":{"start":"node server.js"},"devDependencies":{},"optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.16","_nodeVersion":"v0.6.15","_defaultsLoaded":true,"dist":{"shasum":"9ba272c522488f3c65001f3902359f3873ee0d3d","tarball":"https://registry.npmjs.org/mold/-/mold-0.0.4.tgz","integrity":"sha512-uKbXBrfRdawx1Ss1jBb2cK/BfkIa7RcR1UfOUL/rerQ1TD9yAPSm41k7Rf5rHTzgBsWCxGZxjHPHVssDJViMUw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCRGR/V1iIX/kY+2fx4199ueLH5MiBYffcTtqRAS+2dqwIhAPn9QJPEjbxFWwH+xWf7L6dj1zEshKMWDUelOCWfsdCX"}]},"maintainers":[{"name":"kenneth.koontz","email":"kenneth.koontz@gmail.com"}],"directories":{}},"0.0.6":{"name":"mold","description":"Web Framework","version":"0.0.6","author":{"name":"Kenneth Koontz","email":"kenneth.koontz@gmail.com"},"bin":{"mold":"./mold.js"},"preferGLobal":"true","dependencies":{"commander":"0.5.2","colors":"0.6.0"},"_npmUser":{"name":"kenneth.koontz","email":"kenneth.koontz@gmail.com"},"_id":"mold@0.0.6","scripts":{"start":"node server.js"},"devDependencies":{},"optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.16","_nodeVersion":"v0.6.15","_defaultsLoaded":true,"dist":{"shasum":"d076a4f0929850804dce3adc1da08080f8d3e5fa","tarball":"https://registry.npmjs.org/mold/-/mold-0.0.6.tgz","integrity":"sha512-vj5IokPwc5H+C0622sIVQY5p/PTHzOYWIN/BRstFkRdS9qog2tMhympjGmI676UjA3xH2emMnNmpDERaHf7HVA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDW27nEC9MI6ONkm0dZVTOIhMDd0se/UbjNKHaMMZ6VJgIhANW6IjD3O12olZpt61Wz2IJLRE31K8PFELowp9gpVqMa"}]},"maintainers":[{"name":"kenneth.koontz","email":"kenneth.koontz@gmail.com"}],"directories":{}},"0.0.7":{"name":"mold","description":"Web Framework","version":"0.0.7","author":{"name":"Kenneth Koontz","email":"kenneth.koontz@gmail.com"},"bin":{"mold":"./mold.js"},"preferGLobal":"true","dependencies":{"commander":"0.5.2","colors":"0.6.0"},"scripts":{"start":"node server.js"},"devDependencies":{},"optionalDependencies":{},"engines":{"node":"*"},"_npmUser":{"name":"kenneth.koontz","email":"kenneth.koontz@gmail.com"},"_id":"mold@0.0.7","_engineSupported":true,"_npmVersion":"1.1.16","_nodeVersion":"v0.8.1","_defaultsLoaded":true,"dist":{"shasum":"fa114c784ab67a3ac07c842303b8b2d1fe5f7366","tarball":"https://registry.npmjs.org/mold/-/mold-0.0.7.tgz","integrity":"sha512-NWfuQLKhe+1taPjf+3r55chW5OUx3hume9+0T41QdWFkRR953i9WsspadvCSFXma0TgmZ6Ooaf8nDzILj4JJ8g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG82He4Sye2lcqMYZZa1ujlrULjOl/GnupAXXYXC57INAiAnePa67ZFcKair2r8MzR/LikIh2hBy/g13F41UwKAPAg=="}]},"maintainers":[{"name":"kenneth.koontz","email":"kenneth.koontz@gmail.com"}],"directories":{}},"0.0.8":{"name":"mold","description":"Web Framework","version":"0.0.8","author":{"name":"Kenneth Koontz","email":"kenneth.koontz@gmail.com"},"bin":{"mold":"./mold.js"},"preferGLobal":"true","dependencies":{"commander":"0.5.2","colors":"0.6.0","mime":"1.2.7"},"scripts":{"start":"node server.js"},"devDependencies":{},"optionalDependencies":{},"engines":{"node":"*"},"readme":"### Install mold (npm):\nMold needs to be installed globally.\n\n```\n$ sudo npm install -g mold\n```\n\n#### List mold's help:\n```\n$ mold -h\n```\n\n#### Create an empty mold:\n```\n$ mold create [appname]\n```\n\nThis creates the following structure:\n/[appname]/{static/, views/}\nroutes.js\nactions.js\n\n#### Start server:\nStarting up the server for your app. Change directory into [appname] directory.\n\nThe following starts a server on [port]. The default port is 8000.\n```\n[appname]$ mold startserver [port]\n```\n\nYour server is running. Point your browser to http://localhost:[port].\n\n#### Routing requests to actions using the routes table\n\nMold maps http requests to actions. A request is routed by adding a property to routes.js; with the corresponding action being a property in actions.js.\n\n\nMold's default routes table looks like the following:\n```\nvar routes = module.exports = {\n    '/': 'index',\n};\n```\n\nThis will route any request for '/', to the 'index' action function in actions.js.\n\nTo map a route to an action. Simply define the url and action function. The following maps requests from '/' and '/foobar/add' to the 'index' and 'foobarAdd' function, respectively.\n```\nvar routes = modules.exports = {\n    '/': 'index',\n    '/foobar/add': 'foobarAdd'\n};\n```\n\n### Routing static resources\nMold assumes your static resources reside under the static directory. All static resources such as, css, js, images, etc, should be put in this directory. \n\n#### Defining action logic\nOnce you have a request mapped to an action, you can define the logic in the actions.js file.\n```\nvar actions = module.exports = {\n    index: function () {\n        this.render('./views/index.html');\n    },\n    foobarAdd: function () {\n        var req = this.request,\n            res = this.response;\n        if (req === 'POST') {\n\t    // Do something POSTY; like create a record in the db.\n\t    // Then respond back to client.\n\t    res.writeHead(200);\n\t    res.end()\n        } else {\n\t    this.statusCode(405)\n        }\n    }\n};\n```\n\nNotice that in the 'foobarAdd' function. The request and response objects are made available through 'this'. This allows flexibility and provides each action access to node's request and response objects.\n\nThere are a few functions made available in each action that can assist with handling the logic:\n\n* **this.postData** - Data from a post form.\n* **this.json(obj)** - Takes an object and responds to the request with JSON.\n* **this.statusCode(code)** - Takes a number, representing the status code, responds with a status code.\n* **this.render(pathToFile)** - Take a string, that represents the relative path to a file, whose contents you want to respond with.\n* **this.redirect(url)** - Redirect to url.\n","_id":"mold@0.0.8","dist":{"shasum":"6421435bc39c5a2e01af36f87ef06ac7f80f995b","tarball":"https://registry.npmjs.org/mold/-/mold-0.0.8.tgz","integrity":"sha512-6doTPdmnk2ZeF9WiQob3me/1XXDwRrKqUivJpbhUMFM9MgctBXbCChhru/nDzZy1EMcD/vtr2fl3sEFm0gv0/w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDyB6Vggq2ZFE+TGMD/LHAVVjEwwLhk7oFB9IDGYXQfsAiBkbURg2mo243kO9nnNY9FWYsnfiYq8f45MMfSw6Q0uEQ=="}]},"_from":"mold","_npmVersion":"1.1.49","_npmUser":{"name":"kenneth.koontz","email":"kenneth.koontz@gmail.com"},"maintainers":[{"name":"kenneth.koontz","email":"kenneth.koontz@gmail.com"}],"directories":{}},"0.0.9":{"name":"mold","description":"Web Framework","version":"0.0.9","author":{"name":"Kenneth Koontz","email":"kenneth.koontz@gmail.com"},"bin":{"mold":"./mold.js"},"preferGLobal":"true","dependencies":{"commander":"0.5.2","colors":"0.6.0","mime":"1.2.7"},"scripts":{"start":"node server.js"},"devDependencies":{},"optionalDependencies":{},"engines":{"node":"*"},"readme":"### Install mold (npm):\nMold needs to be installed globally.\n\n```\n$ sudo npm install -g mold\n```\n\n#### List mold's help:\n```\n$ mold -h\n```\n\n#### Create an empty mold:\n```\n$ mold create [appname]\n```\n\nThis creates the following structure:\n/[appname]/{static/, views/}\nroutes.js\nactions.js\n\n#### Start server:\nStarting up the server for your app. Change directory into [appname] directory.\n\nThe following starts a server on [port]. The default port is 8000.\n```\n[appname]$ mold startserver [port]\n```\n\nYour server is running. Point your browser to http://localhost:[port].\n\n#### Routing requests to actions using the routes table\n\nMold maps http requests to actions. A request is routed by adding a property to routes.js; with the corresponding action being a property in actions.js.\n\n\nMold's default routes table looks like the following:\n```\nvar routes = module.exports = {\n    '/': 'index',\n};\n```\n\nThis will route any request for '/', to the 'index' action function in actions.js.\n\nTo map a route to an action. Simply define the url and action function. The following maps requests from '/' and '/foobar/add' to the 'index' and 'foobarAdd' function, respectively.\n```\nvar routes = modules.exports = {\n    '/': 'index',\n    '/foobar/add': 'foobarAdd'\n};\n```\n\n### Routing static resources\nMold assumes your static resources reside under the static directory. All static resources such as, css, js, images, etc, should be put in this directory. \n\n#### Defining action logic\nOnce you have a request mapped to an action, you can define the logic in the actions.js file.\n```\nvar actions = module.exports = {\n    index: function () {\n        this.render('./views/index.html');\n    },\n    foobarAdd: function () {\n        var req = this.request,\n            res = this.response;\n        if (req === 'POST') {\n\t    // Do something POSTY; like create a record in the db.\n\t    // Then respond back to client.\n\t    res.writeHead(200);\n\t    res.end()\n        } else {\n\t    this.statusCode(405)\n        }\n    }\n};\n```\n\nNotice that in the 'foobarAdd' function. The request and response objects are made available through 'this'. This allows flexibility and provides each action access to node's request and response objects.\n\nThere are a few functions made available in each action that can assist with handling the logic:\n\n* **this.postData** - Data from a post form.\n* **this.json(obj)** - Takes an object and responds to the request with JSON.\n* **this.statusCode(code)** - Takes a number, representing the status code, responds with a status code.\n* **this.render(pathToFile)** - Take a string, that represents the relative path to a file, whose contents you want to respond with.\n* **this.redirect(url)** - Redirect to url.\n","_id":"mold@0.0.9","dist":{"shasum":"e381b010e6e8feb54c77dd9cc68ea552b3c0176d","tarball":"https://registry.npmjs.org/mold/-/mold-0.0.9.tgz","integrity":"sha512-4f+Ozf3NjKhKKFAzvHhLywVA/CLKvQliUDQc+z8T4Ll2NEZXwhc4P/vlb25NnmmjCKyhrEMh1tH39eRZq/rgBQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGEETjWPFa3JIGuxjle9WSYc0yQg8fO15AjehXlzM0L3AiAwP6X3UJBzDDjixMunYYSMGzAmjSoj5BHDJobZ4L17HQ=="}]},"_from":"mold","_npmVersion":"1.1.49","_npmUser":{"name":"kenneth.koontz","email":"kenneth.koontz@gmail.com"},"maintainers":[{"name":"kenneth.koontz","email":"kenneth.koontz@gmail.com"}]},"0.0.10":{"name":"mold","description":"Web Framework","version":"0.0.10","author":{"name":"Kenneth Koontz","email":"kenneth.koontz@gmail.com"},"bin":{"mold":"./mold.js"},"preferGLobal":"true","dependencies":{"commander":"0.5.2","colors":"0.6.0","mime":"1.2.7"},"scripts":{"start":"node server.js"},"devDependencies":{},"optionalDependencies":{},"engines":{"node":"*"},"readme":"### Install mold (npm):\nMold needs to be installed globally.\n\n```\n$ sudo npm install -g mold\n```\n\n#### List mold's help:\n```\n$ mold -h\n```\n\n#### Create an empty mold:\n```\n$ mold create [appname]\n```\n\nThis creates the following structure:\n/[appname]/{static/, views/}\nroutes.js\nactions.js\n\n#### Start server:\nStarting up the server for your app. Change directory into [appname] directory.\n\nThe following starts a server on [port]. The default port is 8000.\n```\n[appname]$ mold startserver [port]\n```\n\nYour server is running. Point your browser to http://localhost:[port].\n\n#### Routing requests to actions using the routes table\n\nMold maps http requests to actions. A request is routed by adding a property to routes.js; with the corresponding action being a property in actions.js.\n\n\nMold's default routes table looks like the following:\n```\nvar routes = module.exports = {\n    '/': 'index',\n};\n```\n\nThis will route any request for '/', to the 'index' action function in actions.js.\n\nTo map a route to an action. Simply define the url and action function. The following maps requests from '/' and '/foobar/add' to the 'index' and 'foobarAdd' function, respectively.\n```\nvar routes = modules.exports = {\n    '/': 'index',\n    '/foobar/add': 'foobarAdd'\n};\n```\n\n### Routing static resources\nMold assumes your static resources reside under the static directory. All static resources such as, css, js, images, etc, should be put in this directory. \n\n#### Defining action logic\nOnce you have a request mapped to an action, you can define the logic in the actions.js file.\n```\nvar actions = module.exports = {\n    index: function () {\n        this.render('./views/index.html');\n    },\n    foobarAdd: function () {\n        var req = this.request,\n            res = this.response;\n        if (req === 'POST') {\n\t    // Do something POSTY; like create a record in the db.\n\t    // Then respond back to client.\n\t    res.writeHead(200);\n\t    res.end()\n        } else {\n\t    this.statusCode(405)\n        }\n    }\n};\n```\n\nNotice that in the 'foobarAdd' function. The request and response objects are made available through 'this'. This allows flexibility and provides each action access to node's request and response objects.\n\nThere are a few functions made available in each action that can assist with handling the logic:\n\n* **this.postData** - Data from a post form.\n* **this.json(obj)** - Takes an object and responds to the request with JSON.\n* **this.statusCode(code)** - Takes a number, representing the status code, responds with a status code.\n* **this.render(pathToFile)** - Take a string, that represents the relative path to a file, whose contents you want to respond with.\n* **this.redirect(url)** - Redirect to url.\n","_id":"mold@0.0.10","dist":{"shasum":"a33619a17c45df31281c05edbc2000a28eedf767","tarball":"https://registry.npmjs.org/mold/-/mold-0.0.10.tgz","integrity":"sha512-AyfVr+RisUshkQMgJEP21607w9Q9IZgG7cn97Fd6OiIaqyDTOgX3hdpDh3T7NTRKEkmIecYOBOsGuuiL18VBzw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICWEelhQVFfgfliqHkt0sqAiGyC9kM3jgMap/FcogjotAiEApONm0qu34BXGlJ2pjrNkuduj9BBOcNA0Ux+UWbKIors="}]},"_from":"mold","_npmVersion":"1.1.59","_npmUser":{"name":"kenneth.koontz","email":"kenneth.koontz@gmail.com"},"maintainers":[{"name":"kenneth.koontz","email":"kenneth.koontz@gmail.com"}]},"0.0.11":{"name":"mold","description":"Web Framework","version":"0.0.11","author":{"name":"Kenneth Koontz","email":"kenneth.koontz@gmail.com"},"bin":{"mold":"./mold.js"},"preferGLobal":"true","dependencies":{"commander":"0.5.2","colors":"0.6.0","mime":"1.2.7"},"scripts":{"start":"node server.js"},"devDependencies":{},"optionalDependencies":{},"engines":{"node":"*"},"readme":"### Install mold (npm):\nMold needs to be installed globally.\n\n```\n$ sudo npm install -g mold\n```\n\n#### List mold's help:\n```\n$ mold -h\n```\n\n#### Create an empty mold:\n```\n$ mold create [appname]\n```\n\nThis creates the following structure:\n/[appname]/{static/, views/}\nroutes.js\nactions.js\n\n#### Start server:\nStarting up the server for your app. Change directory into [appname] directory.\n\nThe following starts a server on [port]. The default port is 8000.\n```\n[appname]$ mold startserver [port]\n```\n\nYour server is running. Point your browser to http://localhost:[port].\n\n#### Routing requests to actions using the routes table\n\nMold maps http requests to actions. A request is routed by adding a property to routes.js; with the corresponding action being a property in actions.js.\n\n\nMold's default routes table looks like the following:\n```\nvar routes = module.exports = {\n    '/': 'index',\n};\n```\n\nThis will route any request for '/', to the 'index' action function in actions.js.\n\nTo map a route to an action. Simply define the url and action function. The following maps requests from '/' and '/foobar/add' to the 'index' and 'foobarAdd' function, respectively.\n```\nvar routes = modules.exports = {\n    '/': 'index',\n    '/foobar/add': 'foobarAdd'\n};\n```\n\n### Routing static resources\nMold assumes your static resources reside under the static directory. All static resources such as, css, js, images, etc, should be put in this directory. \n\n#### Defining action logic\nOnce you have a request mapped to an action, you can define the logic in the actions.js file.\n```\nvar actions = module.exports = {\n    index: function () {\n        this.render('./views/index.html');\n    },\n    foobarAdd: function () {\n        var req = this.request,\n            res = this.response;\n        if (req === 'POST') {\n\t    // Do something POSTY; like create a record in the db.\n\t    // Then respond back to client.\n\t    res.writeHead(200);\n\t    res.end()\n        } else {\n\t    this.statusCode(405)\n        }\n    }\n};\n```\n\nNotice that in the 'foobarAdd' function. The request and response objects are made available through 'this'. This allows flexibility and provides each action access to node's request and response objects.\n\nThere are a few functions made available in each action that can assist with handling the logic:\n\n* **this.postData** - Data from a post form.\n* **this.json(obj)** - Takes an object and responds to the request with JSON.\n* **this.statusCode(code)** - Takes a number, representing the status code, responds with a status code.\n* **this.render(pathToFile)** - Take a string, that represents the relative path to a file, whose contents you want to respond with.\n* **this.redirect(url)** - Redirect to url.\n","_id":"mold@0.0.11","dist":{"shasum":"745a174c6f16996f6595bdd012fd20899ec075df","tarball":"https://registry.npmjs.org/mold/-/mold-0.0.11.tgz","integrity":"sha512-gArGCpU0Irr4xdJy1cpxuoU8knzu7pmVaohf58l64dSf5/DOGNBm7DwviXDOdVFvVtTwJ70bDEYcnsWnG7WdHA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQClO83pzRbtXTAxa3Snw9p97UnV8kBfP/tdE8jBHnLhqwIhAKklJoIWUDybd+syaxa9m020lQ+XxLOLuAfY3utMfLqG"}]},"_from":"mold","_npmVersion":"1.1.59","_npmUser":{"name":"kenneth.koontz","email":"kenneth.koontz@gmail.com"},"maintainers":[{"name":"kenneth.koontz","email":"kenneth.koontz@gmail.com"}]}},"readme":"### Install mold (npm):\nMold needs to be installed globally.\n\n```\n$ sudo npm install -g mold\n```\n\n#### List mold's help:\n```\n$ mold -h\n```\n\n#### Create an empty mold:\n```\n$ mold create [appname]\n```\n\nThis creates the following structure:\n/[appname]/{static/, views/}\nroutes.js\nactions.js\n\n#### Start server:\nStarting up the server for your app. Change directory into [appname] directory.\n\n```\n[appname]$ mold startserver\n```\n","maintainers":[{"name":"kenneth.koontz","email":"kenneth.koontz@gmail.com"}],"time":{"modified":"2022-06-20T04:53:03.107Z","created":"2012-04-26T22:14:46.501Z","0.0.1":"2012-04-27T21:36:16.335Z","0.0.2":"2012-04-28T06:25:20.493Z","0.0.3":"2012-05-01T18:41:03.316Z","0.0.4":"2012-07-05T01:18:24.317Z","0.0.5":"2012-07-03T23:53:31.796Z","0.0.6":"2012-07-06T01:24:47.069Z","0.0.7":"2012-07-06T01:53:37.622Z","0.0.8":"2012-12-18T22:30:07.947Z","0.0.9":"2012-12-19T00:04:19.473Z","0.0.10":"2013-02-15T01:20:00.328Z","0.0.11":"2013-02-15T04:10:59.757Z"},"author":{"name":"Kenneth Koontz","email":"kenneth.koontz@gmail.com"},"users":{"jordanskole":true}}