deleteman / vatican

Micro-framework designed to create REST APIs with minor effort
98 stars 6 forks source link

Change resource generator to add working code #10

Closed deleteman closed 10 years ago

deleteman commented 10 years ago

The resource will need a storage module, so we'll go with mongoose for now, but provide ability to add new generators using 3rd party modules.

The generator will probably need to generate:

Example syntax of the cli command:

$ vatican g books -a title:string description:string id:number likes:number 

That will create the basic CRUD actions (with working code) for the books resource.

$ vatican g books -a title:string description:string id:number -m  newBook:post searchBook:get updateBook:put likeBook:put

That will create 4 actions, and we can infer the action to be taken based on the name, so three of them can easily have code:

And "likeBook" might not be generic enough, so we'll just add the method without any code for the dev to fill.

deleteman commented 10 years ago

Closing this, since it's been implemented on v1.3