Skip to content

Commit

Permalink
added sample CRUD operation using redis
Browse files Browse the repository at this point in the history
  • Loading branch information
heinrich10 committed Jul 2, 2017
1 parent df4ac57 commit 9f1a522
Show file tree
Hide file tree
Showing 15 changed files with 1,057 additions and 82 deletions.
20 changes: 10 additions & 10 deletions api.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,36 +8,36 @@ const jsonParser = bodyParser.json();
const app = express();

// models
const User = require('./src/model/user');
const Hello = require('./src/model/hello');

// services
const UserService = require('./src/service/user_service');
const HelloService = require('./src/service/hello_service');

// validators
const UserValidator = require('./src/validator/user_validator');
const HelloValidator = require('./src/validator/hello_validator');

//controllers
const UserController = require('./src/controller/user_controller');
const HelloController = require('./src/controller/hello_controller');

// middlewares
const errorHandler = require('./src/middleware/error_handler');

// routes
const userRoute = require('./src/route/user_route');
const helloRoute = require('./src/route/hello_route');

//instantiate models
const user = new User();
const hello = new Hello();

// instantiate service
const userService = new UserService();
const helloService = new HelloService();

// instantiate validators
const userValidator = new UserValidator();
const helloValidator = new HelloValidator();

// instantiate controllers
const userController = new UserController(userService, user);
const helloController = new HelloController(helloService, hello);

app.use('/users', userRoute(jsonParser, userValidator, userController));
app.use('/hellos', helloRoute(jsonParser, helloValidator, helloController));

app.use(errorHandler);

Expand Down
Loading

0 comments on commit 9f1a522

Please sign in to comment.