Created
January 24, 2013 20:38
-
-
Save verma/4627465 to your computer and use it in GitHub Desktop.
Cruder usage
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var | |
cruder = require("../lib/cruder"), | |
db = require("../lib/db"). MySQLConnection; | |
var c = new cruder.Cruder(db.connection, "locations", | |
["*title", "*address", "lat", "lng", "*url", "list_url", "map_url", "live_url" ]); | |
var app = express(); // app is an express app | |
app.get('/api/locations', c.list(null, "locations")); | |
app.post('/api/locations', c.create()); | |
app.get('/api/locations/:id', c.get()); | |
app.put('/api/locations/:id', c.update()); | |
app.delete('/api/locations/:id', c.delete()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment