Skip to content

SuperJC710e/JW-Notes-Merger-Server

 
 

Repository files navigation

JW Notes Merger Server

Simple server using Express and Node.js for merging JW Library's notes, bookmarks and markup.

Pre-requisites

  • Install Node.js version 15 or higher

Getting started

  • 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

Containerization

  • 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

Endpoints

  • /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" }

Production Environment

About

Simple server for merging JW Library's notes, bookmarks and markup.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 84.7%
  • Scilab 9.0%
  • Dockerfile 6.2%
  • Shell 0.1%