Simple server using Express and Node.js for merging JW Library's notes, bookmarks and markup.
- Install Node.js version 15 or higher
- Clone the repository
git clone https://github.com/LeomaiaJr/JW-Notes-Merger-Server
- Install dependencies
cd JW-Notes-Merger-Server
npm install
- Define environment variables, following the .env.example file
API_PORT=8080
- Run the server in development mode with watch mode
npm run dev
- Build the server for production
npm run build
- Build the container
docker build -t jw-notes-merger-server .
- Run the container
docker run -d -it --rm --name jw-notes-merger-server -p 8080:8080 jw-notes-merger-server:latest
To run it with logging, leave the -d
out of the above command, or run the following after the above:
docker logs -f jw-notes-merger-server
Use ctrl+c
to exit.
To stop and remove the container, run the following:
docker stop jw-notes-merger-server && docker rm -f jw-notes-merger-server
- /merge-db
- POST
- Merge 2 notes files into 1
- Accepts 2 notes files with .jwlibrary extension
- Returns a File with the following properties:
- name: merged
- extension: .jwlibrary
- Example error:
- 400 Bad Request
{ "message": "Two valid files are required" }
{ "message": "Only .jwlibrary files are allowed" }
- 500 Internal Server Error
{ "message": "Unexpected error" }
- 400 Bad Request