2019-05-02 22:04:06 +00:00
|
|
|
import {con} from "../index"
|
2019-03-30 23:39:49 +00:00
|
|
|
import YAML from "yaml"
|
|
|
|
|
|
|
|
export default (req, res) ->
|
2019-05-02 22:04:06 +00:00
|
|
|
query = "SELECT * FROM animes ORDER BY anime_ID DESC "
|
|
|
|
con.query query, (err, respuesta) ->
|
|
|
|
res.send do ->
|
|
|
|
unless err
|
|
|
|
YAML.stringify
|
|
|
|
exito: true
|
|
|
|
payload: respuesta
|
|
|
|
error: {}
|
|
|
|
else
|
|
|
|
"""
|
2019-03-30 23:39:49 +00:00
|
|
|
exito: false
|
|
|
|
payload: {}
|
|
|
|
error:
|
|
|
|
razon: Error al ejecutar la consulta a la base de datos
|
|
|
|
ruta: /Anime/obtenerTodosAnimes
|
|
|
|
adicional: "Query: #{query}\nError: #{err}"
|
|
|
|
"""
|