[+] Deploying guide

This commit is contained in:
Azalea Gui
2023-02-11 16:11:50 -05:00
parent cb07cde549
commit d861897be8
3 changed files with 132 additions and 0 deletions
+34
View File
@@ -0,0 +1,34 @@
## Usage
Those templates dependencies are maintained via [pnpm](https://pnpm.io) via `pnpm up -Lri`.
This is the reason you see a `pnpm-lock.yaml`. That being said, any package manager will work. This file can be safely be removed once you clone a template.
```bash
$ npm install # or pnpm install or yarn install
```
### Learn more on the [Solid Website](https://solidjs.com) and come chat with us on our [Discord](https://discord.com/invite/solidjs)
## Available Scripts
In the project directory, you can run:
### `npm dev` or `npm start`
Runs the app in the development mode.<br>
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
The page will reload if you make edits.<br>
### `npm run build`
Builds the app for production to the `dist` folder.<br>
It correctly bundles Solid in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.<br>
Your app is ready to be deployed!
## Deployment
You can deploy the `dist` folder to any static host provider (netlify, surge, now, etc.)
+44
View File
@@ -0,0 +1,44 @@
# HTTPS
server {
listen 443 ssl;
listen [::]:443 ssl;
# Don't forget to set your domain name here
server_name example.com;
# You can generate SSL certificates for nginx using certbot
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
# The api block
location ^~ /api {
# The path to your static file server
alias "/data/file-server";
autoindex on;
autoindex_format json;
add_header Access-Control-Allow-Origin *;
}
# The MeowIndex web app block
location ^~ / {
alias /etc/nginx/MeowIndex/dist;
# Use sub_filter to configure the app
sub_filter_types application/javascript;
sub_filter_once on;
sub_filter "{HOST-PLACEHOLDER}" "/api";
# Serve index.html on other 404 paths as well
try_files $uri $uri/ /index.html;
}
}
# Redirect HTTP to HTTPS
server
{
listen 80 default_server;
listen [::]:80 default_server;
server_name default;
return 302 https://$host$request_uri;
}