🎲 A NodeJS App that provide a very simple REST API (just GET) from markdown files.
- Fetch markdown files, parse it to create a rest API for blogging
- Environment configuration from a
.envfile, loaded by Node itself (--env-file)
# Get the repo
git clone git+ssh://git@github.com/EmmanuelBeziat/emmanuelbeziat-rest.git
# Navigate into project folder
cd emmanuelbeziat-rest
# Install dependencies
npm iThe app reads its content from filesystem paths and requires the variables
below; they are validated at startup. Copy .env.example to .env and fill
them in, or run npm run setup to generate .env interactively.
PORT=<port>
HOST=<host>
POSTS="<folder path>"
CODES="<folder path>"
PORTFOLIO="<folder path>"
RSS="<rss.xml path>"
CORS_ORIGIN="<allowed origin url>"-
Start the application in development mode:
npm run dev
Compiles the TypeScript sources and runs the app with
node --watchfor hot-reloading. -
Start the application in production mode:
npm run prod
Compiles the sources and runs the compiled app from
dist/. -
Build only:
npm run build
Compiles
src/todist/withtsc. -
Deploy the application:
npm run deploy
Deploys for production using PM2.
-
Run tests:
npm run testRuns the full test suite once with Vitest. Use
npx vitest <file>to run or watch a single test file. -
Lint:
npm run lint
Lints the TypeScript sources in
src/with ESLint.
This project is licensed under the MIT License.