Eastwood is a backend web framework built on node.js. It doesn't use express, or any other node-based frameworks, just node and javascript.
Why should you use Eastwood for your next web project?
- You shouldn't. There aren't enough web frameworks out there yet. You should go write another one.
- No seriously, you shouldn't. I thew this together over a few weekends and it isn't production-ready.
- Because.
- Or maybe you're just feeling lucky.
Eastwood is still incomplete, but it was a great learning process. I felt like I didn't fully understand what was going on behind the scenes with the various backend frameworks I'd used. I wanted to fully understand what happened between the request and the response. Building your own framework is a great way to wrap your head around all of the pieces required to implement a fully functional web framework. Also, node is fun.
Note that, specifically, the model/ORM system isn't fully implemented, but it wouldn't take long to do so.
Features
Template Language
Eastwood has a basic template engine which supports these tags:
- value
- static
- include
- function
urls.json
Your project folder has a urls.json file. This tells Eastwood how to route requests. You have two options:
- html file
- controller
The way it works is simple. If the value has ".html" in the string, it routes to an html file at that path. If not, it assumes there is a controller with that name in your (project)/(controllers)/ folder.
Here's an example urls.json:
{
"/": "index.html",
"/test": "testController"
}
So navigating to
http://www.yourawesomesite.com/
will serve you the page from
(directory where eastwood is running) / (project folder) / index.html
If you navigate to
http://www.yourawesomesite.com/test
then eastwood will call the GET() function on the controller in
(eastwood) / (project) / (controller folder) / testController.js
It's up to you what you want to do from there.
settings.json
The folder where eastwood is running has a settings.json file. This is where you tell it the name of your folders for models, views, controllers, etc.. You can leave the defaults. You probably want to change your site name. Then you can include it in your templates with MathewWelch.com or whatever...
Installation
create a new folder for your app and run npm init.
npm install --save eastwood-app