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.gitGo to the project directory
cd hndailyapiInstall dependencies
pnpm installStart the server
pnpm dev-~~ Add month support~~
- Add year support (?)
ExpressJS, Typescript.
Cheerio for manipulating and parsing HTML documents.
GET /day/2024-04-14GET /month/2024-04