@assetval/counter
v0.0.3
Published
AssetVal's counter workspace
Downloads
8
Readme
Counter
This is the Veritas Counter Schema workspace.
Installation
yarn add @assetval/counter
Usage
As a Class (Front End)
import { Counter } from '@assetval/counter';
const counter = new Counter();
As Schema (Back End)
import { {Counter}Schema, Counter } from '@assetval/counter';
import { Model } from 'mongoose';
export const {Counter}Model = model<Counter>('{counter}es', {Counter}Schema);
As Validation (Back End)
import { {Counter}ValidationSchema } from '@assetval/counter';
import { z } from 'zod';
import { MagikRoutes } from '../middleware/RouterManager.js';
const ProfileRoute = MagikRoutes.getRouter('/profile');
ProfileRoute.post('/updateCounter', {
auth: 'ensureAuthenticated',
validationSchema: z.object({
body: {Counter}ValidationSchema
}),
route: async (req, res): Promise<void> => {
// Do something
}
});
License
MIT
Authors
Contributing
Download the Schema repository and make sure you have the following installed:
- asdf
- NodeJS (ASDF)
- PNPM (Corepack / Node / ASDF)
- NX
Then run the following commands:
pnpm install