Compare commits
No commits in common. "main" and "v0.2.2" have entirely different histories.
3
.gitignore
vendored
3
.gitignore
vendored
@ -2,5 +2,4 @@ node_modules/
|
|||||||
package-lock.json
|
package-lock.json
|
||||||
build/
|
build/
|
||||||
pnpm-lock.yaml
|
pnpm-lock.yaml
|
||||||
.vscode
|
.vscode
|
||||||
.vercel
|
|
@ -4,8 +4,8 @@ WORKDIR /app
|
|||||||
COPY ./package.json ./
|
COPY ./package.json ./
|
||||||
RUN npm install
|
RUN npm install
|
||||||
COPY ./ ./
|
COPY ./ ./
|
||||||
ARG PUBLIC_API_URL=https://publitebackend.dm1sh.ru
|
ENV PUBLIC_API_URL=https://publitebackend.dm1sh.ru
|
||||||
ARG PUBLIC_BASE_URL=https://publite.dm1sh.ru
|
ENV PUBLIC_BASE_URL=https://publite.dm1sh.ru
|
||||||
RUN NODE_ENV=production npm run build
|
RUN NODE_ENV=production npm run build
|
||||||
|
|
||||||
FROM node:alpine
|
FROM node:alpine
|
||||||
|
18
README.md
18
README.md
@ -8,20 +8,6 @@
|
|||||||
|
|
||||||
Frontend for Publite service — E-Books reader
|
Frontend for Publite service — E-Books reader
|
||||||
|
|
||||||
<table style="margin: auto">
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<img style="max-height: 50vh" src="public/images/screenshot3.webp"/>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<img style="max-height: 50vh" src="public/images/screenshot2.webp"/>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<img style="max-height: 50vh" src="public/images/screenshot1.webp"/>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
## Deploy
|
## Deploy
|
||||||
|
|
||||||
Dev environment setup:
|
Dev environment setup:
|
||||||
@ -41,10 +27,10 @@ Simple docker deployment
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
# build docker image
|
# build docker image
|
||||||
docker build . --build-arg PUBLIC_API_URL=<https://...> --build-arg PUBLIC_BASE_URL=<https://...> -t publite_frontend
|
docker build . -t publite_frontend
|
||||||
|
|
||||||
# run it with docker
|
# run it with docker
|
||||||
docker run -p <port>:8080 publite_frontend
|
docker run -p <port>:80 publite_frontend
|
||||||
```
|
```
|
||||||
|
|
||||||
Dokku deployment with image from Docker Hub
|
Dokku deployment with image from Docker Hub
|
||||||
|
@ -5,11 +5,6 @@ import { API_URL } from "~/constants";
|
|||||||
export const validState = (file: File | undefined): file is File => {
|
export const validState = (file: File | undefined): file is File => {
|
||||||
if (!file) throw new Error("Book file is required. Please, attach one");
|
if (!file) throw new Error("Book file is required. Please, attach one");
|
||||||
|
|
||||||
if (file.name.endsWith(".zip"))
|
|
||||||
throw new Error(
|
|
||||||
"Please, unzip file before sending to reader if it is fb2.zip"
|
|
||||||
)
|
|
||||||
|
|
||||||
if (!file.name.match(/\.(fb2|epub)/))
|
if (!file.name.match(/\.(fb2|epub)/))
|
||||||
throw new Error(
|
throw new Error(
|
||||||
"Wrong file type. Only FB2 and Epub files are supported. \
|
"Wrong file type. Only FB2 and Epub files are supported. \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user