Mrakopedia is a wonderful Wiki project for sharing scary stories from the Internet.
The website's engine (MediaWiki) provides a rich API, but a lot of things there are not used by the Mrakopedia website.
The goal of this project is to provide a simple API for the Mrakopedia Reader using Vercel's web framework.
GET /api/search/SEARCH_KEYWORD
Will return the list of pages:
interface IPage {
title: string;
url: string;
}
type Response = Array<IPage>;
GET /api/page/TITLE
Will return Reader-friendly page HTML
GET /api/page/TITLE/related
Will return the list of pages related to choosen one:
interface IPage {
title: string;
url: string;
}
type Response = Array<IPage>;
GET /api/page/TITLE/categories
Will return the list of categories related to choosen one:
interface ICategory {
title: string;
url: string;
}
type Response = Array<ICategory>;
GET /api/page/TITLE/picture
Will return the image (jpg
/png
/svg
) for the page
GET /api/page/TITLE/source
Will return the link to the Mrakopedia:
interface IMrakopediaSource {
title: string;
url: string;
}
GET /api/categories
Will return the list of categories:
interface ICategory {
title: string;
url: string;
}
type Response = Array<ICategory>;
GET /api/categories/CATEGORY_NAME
Will return the list of pages related to choosen category:
interface IPage {
title: string;
url: string;
}
type Response = Array<IPage>;
GET /api/random
Will return the random page:
interface IPage {
title: string;
url: string;
}
GET /api/hotm
Will return the list of stories of month:
interface IPage {
title: string;
url: string;
}
type Response = Array<IPage>;
Please note, SEARCH_KEYWORD
, TITLE
, and CATEGORY_NAME
should be escaped first.
npm start
npm run deploy:dev
npm run deploy:prod
npm run tscheck