Guest User

Untitled

a guest
Nov 20th, 2017
544
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. const question = {
  2. _id: 1,
  3. title: '¿Cómo reutilizo un componente en Android?',
  4. description: 'Miren esta es mi pregunta',
  5. createdAt: new Date(),
  6. icon: 'devicon-android-plain',
  7. answers: [],
  8. user: {
  9. firstName: 'David',
  10. lastName: 'Castillo',
  11. email: 'davecas26@gmail.com',
  12. password: '123456'
  13. }
  14. }
  15.  
  16. const questions = new Array(10).fill(question)
  17.  
  18. function getQuestions (req, res) {
  19. res.status(200).json(questions)
  20. }
  21.  
  22. function getQuestion (req, res) {
  23. res.status(200).json(question)
  24. }
  25.  
  26. export default {
  27. getQuestions,
  28. getQuestion
  29. }
Add Comment
Please, Sign In to add comment