Quantcast
Channel: CodeSection,代码区,网络安全 - CodeSec
Viewing all articles
Browse latest Browse all 12749

Simple Hacker News clone

$
0
0
Hacker News example

Live demo

A Hacker News clone built with NX , which features client-side routing, real-time updates and animations.

Usage

Clone the repo and run npm i and npm start . The npm start command bundles the source and starts a local server. The demo is exposed on localhost:3000 .

Project structure

The project is structured in the following way.

The src folder includes the API and the components of the app. The source is bundled with Webpack . You can find the webpack config in src . bundle.js is the app's source and NX - bundled together by webpack. index.html imports the bundled source script and has a single <hacker-news> component in its body, which is the root component. server.js is only used for local testing, as the page is hosted on Github Pages. It serves as a simple server example for single page applications.

Viewing all articles
Browse latest Browse all 12749

Trending Articles