Skip to content

Commit 0569c14

Browse files
Merge pull request #138 from adityak74/api-server-readme
feat: add server api readme docs
2 parents 0bd16b5 + 0f4e58b commit 0569c14

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Crawl a site to generate knowledge files to create your own custom GPT from one
1515
- [Running in a container with Docker](#running-in-a-container-with-docker)
1616
- [Running as a CLI](#running-as-a-cli)
1717
- [Development](#development)
18+
- [Running as an API](#running-as-an-api)
1819
- [Upload your data to OpenAI](#upload-your-data-to-openai)
1920
- [Create a custom GPT](#create-a-custom-gpt)
2021
- [Create a custom assistant](#create-a-custom-assistant)
@@ -103,6 +104,18 @@ npm start
103104

104105
To obtain the `output.json` with a containerized execution, go into the `containerapp` directory and modify the `config.ts` as shown above. The `output.json`file should be generated in the data folder. Note: the `outputFileName` property in the `config.ts` file in the `containerapp` directory is configured to work with the container.
105106

107+
#### Running as an API
108+
109+
To run the app as a API server you will need to do an `npm install` to install the dependencies. The server is written in Express JS.
110+
111+
To run the server.
112+
113+
`npm run start:server` to start the server. The server runs by default on port 3000.
114+
115+
You can use the endpoint `/crawl` with the post request body of config json to run the crawler. The api docs are served on the endpoint `/api-docs` and are served using swagger.
116+
117+
To modify the environment you can copy over the `.env.example` to `.env` and set your values like port, etc. to override the variables for the server.
118+
106119
### Upload your data to OpenAI
107120

108121
The crawl will generate a file called `output.json` at the root of this project. Upload that [to OpenAI](https://platform.openai.com/docs/assistants/overview) to create your custom assistant or custom GPT.

0 commit comments

Comments
 (0)