Browse Source

update README dev commands & other commentary

master
Trent Larson 4 days ago
parent
commit
f90ceae617
  1. 2
      Dockerfile
  2. 6
      README.md
  3. 2
      src/server.ts
  4. 2
      src/vc/did-eth-local-resolver.ts

2
Dockerfile

@ -7,7 +7,7 @@ RUN apk add git
RUN git clone https://gitea.anomalistdesign.com/log-trade/image-api.git
WORKDIR image-api
RUN git checkout $IMAGE_API_VERSION
# dev dependencies like TypeScript are needed to build
# dev dependencies like TypeScript are needed to build, so run it and then run the prod install later
RUN pnpm install
RUN pnpm build
RUN pnpm install --prod

6
README.md

@ -1,8 +1,5 @@
# Image Server
Remaining:
- dockerize
## setup
```
@ -23,7 +20,8 @@ AWS_REGION=
## dev
```
node src/server.js
npm run build
npm start
```
## test

2
src/server.ts

@ -77,7 +77,7 @@ app.get('/image-limits', async (req, res) => {
* - "image" file Blob
* - "claimType" (optional, eg. "GiveAction", "PlanAction", "profile")
* - "handleId" (optional)
* - "fileName" (optional, if you want to replace an previous image)
* - "fileName" (optional, if you want to replace a previous image)
*/
app.post('/image', uploadMulter.single('image'), async (req, res) => {
const reqFile = req.file;

2
src/vc/did-eth-local-resolver.ts

@ -9,7 +9,7 @@ import {DIDResolutionResult} from "did-resolver";
* @param did : string
* @returns {Promise<DIDResolutionResult>}
*
* Similar code resides in endorser-ch
* Similar code resides in crowd-funder-for-time-pwa and endorser-ch
*/
export const didEthLocalResolver = async(did: string): Promise<DIDResolutionResult> => {
const didRegex = /^did:ethr:(0x[0-9a-fA-F]{40})$/;

Loading…
Cancel
Save