Certainly! Here's an updated README file for the project you provided, incorporating the scripts you mentioned:
POC Rendering SSR (Proof of Concept for Server-Side Rendering)
This project serves as a proof of concept for server-side rendering (SSR). It demonstrates how to implement SSR using a specific technology stack and showcases the benefits of server-side rendering for rendering web pages.
The project utilizes [technology name] to build a server-side rendering application that enhances initial page load performance and improves search engine optimization (SEO). By rendering HTML on the server and sending a pre-rendered page to the client, SSR ensures faster page rendering and better visibility on search engines.
- Clone the repository:
git clone https://github.com/LucasMallmann/poc-rendering-ssr.git
- Change to the project directory:
cd poc-rendering-ssr
- Install dependencies:
npm install
- Build the project:
npm run build && npm run serve
- Open your web browser and visit
http://localhost:3033
To build the project for production, follow these steps:
- Build the client bundle:
npm run build:client
- Build the server bundle:
npm run build:server
- The compiled files will be available in the
dist/client
anddist/server
directories, respectively.
To generate pre-rendered pages for production:
- Build the client bundle and static assets:
npm run generate
- This command will generate the client bundle in
dist/client
and the server bundle indist/server
. Additionally, it will generate static assets indist/static
. - Run the prerendering process:
node prerender
- The pre-rendered pages will be generated in the
dist/static
directory.
To serve the production build:
- Set the environment to production:
cross-env NODE_ENV=production
- Start the server:
node server
- Open your web browser and visit the provided URL.
Contributions are welcome! If you find any issues or would like to add new features, please follow these steps:
- Fork the repository
- Create a new branch:
git checkout -b my-feature-branch
- Make your changes and commit them:
git commit -am 'Add new feature'
- Push to the branch