Don't specify Nightbot headers in the endpoint and prevent GET requests
This commit is contained in:
parent
70e1b46f4c
commit
f8d9145431
1 changed files with 1 additions and 3 deletions
|
|
@ -1,19 +1,17 @@
|
||||||
import { channelNameSchema, counterNameSchema } from "$/schemas/params";
|
import { channelNameSchema, counterNameSchema } from "$/schemas/params";
|
||||||
import { nightbotCustomHeadersSchema } from "$/schemas/nightbot";
|
|
||||||
import { config, database } from "$/main";
|
import { config, database } from "$/main";
|
||||||
import { ServerRoute } from "@hapi/hapi";
|
import { ServerRoute } from "@hapi/hapi";
|
||||||
import boom from "@hapi/boom";
|
import boom from "@hapi/boom";
|
||||||
import Joi from "joi";
|
import Joi from "joi";
|
||||||
|
|
||||||
const route: ServerRoute = {
|
const route: ServerRoute = {
|
||||||
method: [ `GET`, `PATCH` ], path: `/channels/{channel}/counters/{counter}`,
|
method: `PATCH`, path: `/channels/{channel}/counters/{counter}`,
|
||||||
options: {
|
options: {
|
||||||
validate: {
|
validate: {
|
||||||
params: Joi.object({
|
params: Joi.object({
|
||||||
channel: channelNameSchema,
|
channel: channelNameSchema,
|
||||||
counter: counterNameSchema,
|
counter: counterNameSchema,
|
||||||
}),
|
}),
|
||||||
headers: nightbotCustomHeadersSchema.unknown(),
|
|
||||||
query: Joi.object({
|
query: Joi.object({
|
||||||
delta: Joi.number().integer().required(),
|
delta: Joi.number().integer().required(),
|
||||||
}),
|
}),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue