Sunday, February 12, 2017

Expressjs + Compound : Generate scaffolding for Lists

Generate scaffolding for Lists

Run this command:
`compound generate scaffold list name`
It will generate all necessary files for the List model.
if you haven't already done so, stop the server using the CTRL+C hotkey and restart it using node . (or your preferred startup command) so that you can review the changes in your browser.
In development mode every modification of an existing model, controller or view file will be updated automatically, but when you modify routes or schema you have to restart the server manually. Alternatively use the node-dev command (npm install node-dev first) to restart server automatically on every file change.
Now, visit http://localhost:3000/lists to see the new version of your app.
Now that we have some files in our application, it's time to explore the structure. Let's get a brief overview of the files we have to get our new lists CRUD functionality (create-read-update-delete) working.

C:\Node4Express\todo-list>compound generate scaffold list name
express deprecated app.configure: Check app.get('env') in an if statement config
\environment.js:6:9
connect deprecated methodOverride: use method-override npm module instead config
\environment.js:16:25
express deprecated app.configure: Check app.get('env') in an if statement config
\environments\development.js:6:9
exists  app/
exists  app/controllers/
exists  app/helpers/
exists  app/views/
create  app/views/lists/
exists  app/views/layouts
create  test/
create  test/controllers/
create  app/controllers/lists_controller.js
exists  app/
exists  app/models/
create  app/models/list.js
patch   db/schema.js
create  app/views/layouts/lists_layout.ejs
create  app/views/lists/_form.ejs
create  app/views/lists/show.ejs
create  app/views/lists/new.ejs
create  app/views/lists/edit.ejs
create  app/views/lists/index.ejs
create  app/helpers/lists.js
create  test/controllers/lists_controller_test.js
create  test/test_helper.js
patch   config/routes.js

C:\Node4Express\todo-list>

No comments:

Post a Comment