Testing handlebars and javascript functionality.
To run the application using docker run:
docker-compose up -d
Handlebars files go to views directory.
Example on how to access handlebars:
curl --location --request POST 'http://localhost:3000/hbs/my/restful/url/myFile' --data ''NB! js is for historic/backwards-compatibility and due to other Bürokratt services mapping js folder as volumes. Code itself is TypeScript.
Javascript files go to js directory.
Example on how to access javascript files in browser:
http://localhost:3000/js/example/examples
Note! URL must not end with .js extension.
To develop the DataMapper, it's recommended to have nvm installed, which will ensure you have the correct node and npm versions.
# Install the required node version
nvm install
# Switch to the required node version
nvm use
# Install node dependencies
npm install
# Development mode (hot reload)
npm run dev
# Production build
npm run build
# Run the compiled app
npm startnpm run format # Check if the code is formatted, without making changes
npm run format:fix # Format the codenpm run lint # Check for linting issues, without making changes
npm run lint:fix # Automatically fix linting issuesTests are written in TypeScript (and the project should be migrated to TypeScript in the future too). Available npm scripts:
npm test # Run tests in watch mode
npm run test:run # Run tests once
npm run test:coverage # Run tests with coverageFormat, lint, test, and build checks are run on every commit to PRs that are not in Draft status. These checks are configured in this workflow.