How alassa50/urlalaplage works
Project type and purpose
• This is a modular, experimental Node.js API service for URL transformation.
• It demonstrates four URL-shortening techniques (youpi-prefix, compression, in-memory ID mapping, 4-char ID) plus logging and basic benchmarking.
File structure
• Top-level files:
• server.js: application entrypoint that wires Express, CORS, logging, routes.
• package.json / lock: dependency definitions.
• src/ directory:
• youpi.js + youpi.rest – modules and test definitions for “youpi” URL decorator.
• compress.js + compress.rest – compression-based URL shortener.
• memory.js + memory.rest – in-memory map based shortener.
• utils/logger.js + utils/mem-db.js – shared logging and a simple in-memory DB.
• data/db.db – a SQLite file used by one of the approaches (if implemented).
• benchmark/benchmark-run.js – run benchmarking with autocannon.
README for architectural insights
• The app is a single Express application exposing multiple endpoints.
• It uses middleware (CORS, body-parser, morgan/pino) and may swap storage backends.
• No external microservices—just optional file or in-memory stores.