fastify api server (the project inspiration comes from fastify-ts-starter)
- be ready to nodejs
- be ready to mysql
- modify database related information
CREATE TABLE `user` (
`id` int NOT NULL AUTO_INCREMENT,
`username` varchar(255) NOT NULL,
`pwd` varchar(255) NOT NULL,
`salt` varchar(255) NOT NULL,
`email` varchar(255) NOT NULL,
`deletedAt` timestamp NULL DEFAULT NULL,
`createdAt` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`updatedAt` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
)
pnpm i
pnpm run build
pnpm run start
-
HTTP method:
GET
-
Request URL:
http://[domain]/api/version
-
Response parameters:
parameters | subparameters | type | description |
---|---|---|---|
statuscode | - | int | Status code 200 indicates success, non 200 indicates failure |
message | - | string | Reminder information |
data | - | string | Return results |
- Response example:
{ "statuscode": 200, "message": "success", "data": "v1.0.0" }