Skip to content

Commit 13f133f

Browse files
authored
Merge pull request #101 from codfish/updates
Node v20, Typescript, Improved documentation
2 parents 6438a47 + 8c8a12e commit 13f133f

24 files changed

+3792
-603
lines changed

.github/PULL_REQUEST_TEMPLATE.md

-7
This file was deleted.

.github/workflows/validate.yml

+19-2
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,22 @@ jobs:
1919
- name: lint js
2020
run: npm run lint
2121

22-
- name: ensure the image builds properly
23-
run: docker-compose build
22+
- name: Docker meta
23+
id: meta
24+
uses: docker/metadata-action@v4
25+
with:
26+
images: codfish/json-server
27+
28+
- name: Login to DockerHub
29+
uses: docker/login-action@v2
30+
with:
31+
username: ${{ secrets.DOCKERHUB_USERNAME }}
32+
password: ${{ secrets.DOCKERHUB_TOKEN }}
33+
34+
- name: Build and push
35+
uses: docker/build-push-action@v4
36+
with:
37+
context: .
38+
push: true
39+
tags: ${{ steps.meta.outputs.tags }}
40+
labels: ${{ steps.meta.outputs.labels }}

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -93,3 +93,4 @@ typings/
9393
# Custom
9494
dist
9595
build
96+
api

.nvmrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v18.15.0
1+
v20.2.0

Dockerfile

+12-7
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
1-
FROM node:18.15.0-slim
1+
FROM node:20.2.0-slim
22

33
RUN mkdir /app
44
WORKDIR /app
55

6-
ENV JSON_SERVER_VERSION=0.17.3
7-
8-
RUN npm install -g json-server@${JSON_SERVER_VERSION}
96
COPY package.json package-lock.json ./
10-
RUN npm ci --only="prod"
7+
RUN npm ci --omit=dev
8+
RUN npm install -g --save-exact [email protected] [email protected]
119

12-
COPY ./db.js ./middleware.js ./routes.json ./server.sh ./
10+
# copy in files
11+
COPY ./tsconfig.json \
12+
./db.js \
13+
./middleware.js \
14+
./routes.json \
15+
./server.sh \
16+
./main.sh ./
1317

1418
EXPOSE 80
15-
CMD [ "./server.sh" ]
19+
20+
CMD [ "./main.sh" ]

LICENSE

+18-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,21 @@
1-
The MIT License (MIT)
2-
Copyright (c) 2019 Chris O'Donnell
1+
MIT License
32

4-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
3+
Copyright (c) 2023 Chris O'Donnell
54

6-
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
711

8-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)