forked from caelum/restfulie-nodejs
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed bugs implemented other tests, bodyDataReader refactored
- Loading branch information
1 parent
98e7bac
commit cb5d581
Showing
12 changed files
with
158 additions
and
67 deletions.
There are no files selected for viewing
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
This file was deleted.
Oops, something went wrong.
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
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
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
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
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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,43 @@ | |||
var restfulie = require("../../lib/restfulie") | |||
|
|||
var clientes = []; | |||
function ClientesResource(){ | |||
|
|||
this.index = function(){ | |||
console.log("clientes"); | |||
console.log(clientes); | |||
return clientes; | |||
} | |||
|
|||
this.show = function(id){ | |||
console.log("show"+id); | |||
return clientes[id]; | |||
} | |||
|
|||
this.destroy = function(id){ | |||
console.log("destroy"+ id); | |||
delete clientes[id]; | |||
} | |||
|
|||
this.create = function(cliente){ | |||
console.log("criar"); | |||
console.log(cliente); | |||
clientes.push(cliente); | |||
} | |||
|
|||
this.update = function(cliente,id){ | |||
console.log("update"); | |||
console.log(id); | |||
console.log(cliente); | |||
clientes[id] = cliente; | |||
} | |||
|
|||
} | |||
|
|||
server = restfulie.createServer(); | |||
|
|||
server.registerResource(ClientesResource); | |||
server.listen(3000,"127.0.0.1"); | |||
|
|||
console.log("initialized."); | |||
|
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
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
This file was deleted.
Oops, something went wrong.
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
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