Skip to content

About

🎲 A NodeJS App that provide a very simple REST API (just GET) from markdown files

Topics

Resources

Stars

4 stars

Watchers

1 watching

Forks

Latest commit

 

History

348 Commits

Folders and files

Repository files navigation

Emmanuel Béziat Logo

emmanuelbeziat-rest :: Emmanuel Béziat

🎲 A NodeJS App that provide a very simple REST API (just GET) from markdown files.

Built with Language

What?

  • Fetch markdown files, parse it to create a rest API for blogging
  • Environment configuration from a .env file, loaded by Node itself (--env-file)

Installation

# Get the repo
git clone git+ssh://git@github.com/EmmanuelBeziat/emmanuelbeziat-rest.git

# Navigate into project folder
cd emmanuelbeziat-rest

# Install dependencies
npm i

Configuration

The 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>"

Usage

  • Start the application in development mode:

    npm run dev

    Compiles the TypeScript sources and runs the app with node --watch for 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/ to dist/ with tsc.

  • Deploy the application:

    npm run deploy

    Deploys for production using PM2.

  • Run tests:

    npm run test

    Runs 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.

License

This project is licensed under the MIT License.

About

🎲 A NodeJS App that provide a very simple REST API (just GET) from markdown files

Topics

Resources

Stars

4 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages