Now unused. See florimondmanca/www.
This is the repository for the frontend application powering my personal blog.
For the backend API, see personal-api.
Install Angular CLI:
$ npm install -g @angular/cli
Install the dependencies:
$ npm install
Create an environment file called .env
(it will be excluded from version control) at the project root, containing the following variables:
API_KEY
: a valid API key created via the backend admin site.BACKEND_URL
: the URL to the backend root (without trailing slash).
For example:
# .env
API_KEY=myapikey
BACKEND_URL=http://localhost:8000
Generate your development environment file:
$ npm run config -- --env=dev
Start the development server, which will run on http://localhost:4200/
:
$ ng serve -c dev
Server side rendering is implemented using Angular Universal.
Server-side rendering allows to send fully-rendered HTML pages to clients, instead of sending them a blank page and letting Angular fill it in the browser. This reduces the "first meaningful paint" time, helps with referencing and allows integration with social media.
To use the server-rendered app, you must first create a build of the app:
$ npm run build:dev
Note: in production, use
npm run build
instead to create a production-optimized build.
Then start the server-rendered app (an Express server):
$ npm run serve:ssr
See package.json
for the available NPM scripts.
TravisCI is configured on this repo and generates a production build on every push to a branch.