REST API built with TypeScript and Express for HN Daily
If it is not yet obvious, I am obviously a Hacker News addict. I regularly visit the site to get my daily dose of dopamine. HN Daily gives the daily top stories from Hacker News. These are nicely sorted by day, month, as well as year. This is my attempt to create a simple Express web application using TypeScript so that building bots or frontends for this will be simpler.
GET /
Parameter | Type | Description |
---|---|---|
none |
none |
Homepage |
GET /day
Parameter | Type | Description |
---|---|---|
none |
none |
Defaults to show today's top stories |
GET /date/${date}
Parameter | Type | Description |
---|---|---|
date |
string |
Required. Date in YYYY-MM-DD format. |
GET /month
Parameter | Type | Description |
---|---|---|
none |
none |
Defaults to show this month's top stories. |
GET /month/${date}
Parameter | Type | Description |
---|---|---|
date |
string |
Required. Date in YYYY-MM format. |
Clone the project
git clone https://github.com/byt3h3ad/hndailyapi.git
Go to the project directory
cd hndailyapi
Install dependencies
pnpm install
Start the server
pnpm dev
-~~ Add month support~~
- Add year support (?)
ExpressJS, Typescript.
Cheerio for manipulating and parsing HTML documents.
GET /day/2024-04-14
GET /month/2024-04