import { Request , Response } from 'express' ; import EmailService from '../services/EmailService' ; const users = [ { name : 'Diego' , email : 'diego@rocketseat.com.br' } , ] ; export default { async index ( req , res ) { return res . json ( users ) ; } , async create ( req , res ) { const emailService = new EmailService ( ) ; emailService . sendMail ( { to : { name : 'Diego Fernandes' , email : 'diego@rocketseat.com.br' } , message : { subject : 'Bem-vindo ao sistema' , body : 'Seja bem-vindo' } } ) ; return res . send ( ) ; } } ;