diff --git a/docs/Endpoints.md b/docs/Endpoints.md index 3fcc796..caa5998 100644 --- a/docs/Endpoints.md +++ b/docs/Endpoints.md @@ -1,6 +1,6 @@ ## Endpoints -> PATH: /lastest +> PATH: /latest |Querys|Params| |-|-| diff --git a/src/controllers/index.ts b/src/controllers/index.ts index 3d912f2..085ebbb 100644 --- a/src/controllers/index.ts +++ b/src/controllers/index.ts @@ -1,6 +1,6 @@ export * from './all' export * from './anime' -export * from './lastest' +export * from './latest' export * from './calendar' export * from './emision' export * from './search' diff --git a/src/controllers/lastest.ts b/src/controllers/latest.ts similarity index 92% rename from src/controllers/lastest.ts rename to src/controllers/latest.ts index 5684d7f..11f36f3 100644 --- a/src/controllers/lastest.ts +++ b/src/controllers/latest.ts @@ -1,7 +1,7 @@ import { Controller } from '../types' import { get, parse, attr, url } from '../api' -export const getLastest: Controller = async (req, res) => { +export const getLatest: Controller = async (req, res) => { try { const { data } = await get(url) const html = parse(data) diff --git a/src/router.ts b/src/router.ts index fdedb9e..dfe3459 100644 --- a/src/router.ts +++ b/src/router.ts @@ -1,7 +1,7 @@ import { Router } from 'express' import { getAll, - getLastest, + getLatest, getCalendar, getEmision, getAnime, @@ -18,7 +18,7 @@ routes.get('/', (_, res) => { author: 'Carlos Burelo', repository: 'https://github.com/carlos-burelo/monoschinos-api-v2', endpoints: { - lastest: '/lastest', + latest: '/latest', emision: '/emision', calendar: '/week', getAnimeByID: '/anime/:id', @@ -34,7 +34,7 @@ routes.get('/', (_, res) => { }) routes.get('/all', getAll) -routes.get('/lastest', getLastest) +routes.get(['/lastest', '/latest'], getLatest) routes.get('/week', getCalendar) routes.get('/emision', getEmision) routes.get('/anime/:id', getAnime) diff --git a/src/types.d.ts b/src/types.d.ts index 7b2ba8b..13d65cd 100644 --- a/src/types.d.ts +++ b/src/types.d.ts @@ -2,7 +2,7 @@ import { Request, Response } from 'express' export type Controller = (req: Request, res: Response) => void -export interface Lastest { +export interface Latest { id: string title: string image: string