Spaces:
Runtime error
Runtime error
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,118 +1,8 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
```
|
| 10 |
-
βββ __tests__
|
| 11 |
-
β βββ resume-invalid-json.test.js
|
| 12 |
-
β βββ resume-internal-server-error.test.js
|
| 13 |
-
β βββ resume-success.test.js
|
| 14 |
-
β βββ resume-template-not-found.test.js
|
| 15 |
-
β βββ resume-unauthorized.test.js
|
| 16 |
-
βββ node_modules
|
| 17 |
-
βββ public
|
| 18 |
-
β βββ images
|
| 19 |
-
β β βββ BasicTemplatePhoto.jpg
|
| 20 |
-
β β βββ ImageTemplatePhoto.jpg
|
| 21 |
-
β β βββ LinkTemplatePhoto.jpg
|
| 22 |
-
β βββ script.js
|
| 23 |
-
β βββ styles.css
|
| 24 |
-
βββ routers
|
| 25 |
-
β βββ resume.js
|
| 26 |
-
β βββ views.js
|
| 27 |
-
βββ src
|
| 28 |
-
β βββ api-app.js
|
| 29 |
-
β βββ constants.js
|
| 30 |
-
β βββ pdf.js
|
| 31 |
-
β βββ server.js
|
| 32 |
-
β βββ validation.js
|
| 33 |
-
β βββ view-app.js
|
| 34 |
-
βββ temp
|
| 35 |
-
βββ Templates(Templates Data)
|
| 36 |
-
βββ views
|
| 37 |
-
β βββ form.ejs
|
| 38 |
-
βββ .gitignore
|
| 39 |
-
βββ certificate_pub.crt
|
| 40 |
-
βββ LICENSE
|
| 41 |
-
βββ package-lock.json
|
| 42 |
-
βββ package.json
|
| 43 |
-
βββ pdfservices-api-credentials.json
|
| 44 |
-
βββ private.key
|
| 45 |
-
βββ README.md
|
| 46 |
-
```
|
| 47 |
-
|
| 48 |
-
## Setup
|
| 49 |
-
|
| 50 |
-
To set up the API, follow these steps:
|
| 51 |
-
|
| 52 |
-
1. Set up AdobePdfServices credentials by following the instructions in [Adobe's Document Generation API Quickstarts for Node.js](https://developer.adobe.com/document-services/docs/overview/document-generation-api/quickstarts/nodejs/).
|
| 53 |
-
|
| 54 |
-
2. Install the application's dependencies by running the command:
|
| 55 |
-
|
| 56 |
-
```shell
|
| 57 |
-
npm i
|
| 58 |
-
```
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
3. Place the `pdfservices-api-credentials.json` file in the root folder of the project.
|
| 62 |
-
set the env variables
|
| 63 |
-
|
| 64 |
-
**Windows (CMD):**
|
| 65 |
-
```shell
|
| 66 |
-
set PDF_SERVICES_CLIENT_ID=<YOUR_CLIENT_ID>
|
| 67 |
-
set PDF_SERVICES_CLIENT_SECRET=<YOUR_CLIENT_SECRET>
|
| 68 |
-
```
|
| 69 |
-
|
| 70 |
-
**MacOS/Linux:**
|
| 71 |
-
```shell
|
| 72 |
-
export PDF_SERVICES_CLIENT_ID=<YOUR_CLIENT_ID>
|
| 73 |
-
export PDF_SERVICES_CLIENT_SECRET=<YOUR_CLIENT_SECRET>
|
| 74 |
-
```
|
| 75 |
-
.
|
| 76 |
-
## Technologies Used
|
| 77 |
-
|
| 78 |
-
The technologies used in this API are:
|
| 79 |
-
|
| 80 |
-
- Jest: A JavaScript testing framework.
|
| 81 |
-
- EJS: A templating engine for generating HTML markup with JavaScript.
|
| 82 |
-
- Express: A web application framework for Node.js.
|
| 83 |
-
- AdobePdfServices SDK: A software development kit for interacting with Adobe's PDF services.
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
## API Endpoints
|
| 87 |
-
|
| 88 |
-
The API provides the following endpoint:
|
| 89 |
-
|
| 90 |
-
- `POST /resume`: Generates a resume in PDF format based on the provided data.
|
| 91 |
-
|
| 92 |
-
## Usage
|
| 93 |
-
|
| 94 |
-
To use the API:
|
| 95 |
-
|
| 96 |
-
1. Start the API server by running the command:
|
| 97 |
-
|
| 98 |
-
```shell
|
| 99 |
-
npm run dev
|
| 100 |
-
```
|
| 101 |
-
|
| 102 |
-
2. Send a POST request to `http://localhost:8080/resume` with the necessary data in the request body to generate a resume in PDF format and
|
| 103 |
-
the view is hosted at `http://localhost:3000`
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
## Unit Testing
|
| 107 |
-
|
| 108 |
-
To run the unit tests and view the results, use the command:
|
| 109 |
-
|
| 110 |
-
```shell
|
| 111 |
-
npm test
|
| 112 |
-
```
|
| 113 |
-
Conducted unit tests over 77 cases and 5 test suites
|
| 114 |
-
## License
|
| 115 |
-
|
| 116 |
-
This project is licensed under the [MIT License](LICENSE).
|
| 117 |
-
|
| 118 |
-
Feel free to explore and modify the API according to your needs!
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: Basic Docker SDK Space
|
| 3 |
+
emoji: π³
|
| 4 |
+
colorFrom: purple
|
| 5 |
+
colorTo: gray
|
| 6 |
+
sdk: docker
|
| 7 |
+
app_port: 7860
|
| 8 |
+
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|