Move api calls to /api/v0 subpath
This commit is contained in:
parent
37ee6f9593
commit
6748f065ef
8 changed files with 15 additions and 15 deletions
|
@ -3,7 +3,7 @@ const std = @import("std");
|
||||||
|
|
||||||
pub const login = struct {
|
pub const login = struct {
|
||||||
pub const method = .POST;
|
pub const method = .POST;
|
||||||
pub const path = "/auth/login";
|
pub const path = "/api/v0/auth/login";
|
||||||
|
|
||||||
pub const Body = struct {
|
pub const Body = struct {
|
||||||
username: []const u8,
|
username: []const u8,
|
||||||
|
@ -21,7 +21,7 @@ pub const login = struct {
|
||||||
|
|
||||||
pub const verify_login = struct {
|
pub const verify_login = struct {
|
||||||
pub const method = .GET;
|
pub const method = .GET;
|
||||||
pub const path = "/auth/login";
|
pub const path = "/api/v0/auth/login";
|
||||||
|
|
||||||
pub fn handler(_: anytype, res: anytype, srv: anytype) !void {
|
pub fn handler(_: anytype, res: anytype, srv: anytype) !void {
|
||||||
const info = try srv.verifyAuthorization();
|
const info = try srv.verifyAuthorization();
|
||||||
|
|
|
@ -5,7 +5,7 @@ const QueryArgs = api.CommunityQueryArgs;
|
||||||
|
|
||||||
pub const create = struct {
|
pub const create = struct {
|
||||||
pub const method = .POST;
|
pub const method = .POST;
|
||||||
pub const path = "/communities";
|
pub const path = "/api/v0/communities";
|
||||||
|
|
||||||
pub const Body = struct {
|
pub const Body = struct {
|
||||||
origin: []const u8,
|
origin: []const u8,
|
||||||
|
@ -20,7 +20,7 @@ pub const create = struct {
|
||||||
|
|
||||||
pub const query = struct {
|
pub const query = struct {
|
||||||
pub const method = .GET;
|
pub const method = .GET;
|
||||||
pub const path = "/communities";
|
pub const path = "/api/v0/communities";
|
||||||
|
|
||||||
pub const Query = QueryArgs;
|
pub const Query = QueryArgs;
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ const api = @import("api");
|
||||||
|
|
||||||
pub const create = struct {
|
pub const create = struct {
|
||||||
pub const method = .POST;
|
pub const method = .POST;
|
||||||
pub const path = "/invites";
|
pub const path = "/api/v0/invites";
|
||||||
|
|
||||||
pub const Body = api.InviteOptions;
|
pub const Body = api.InviteOptions;
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ const util = @import("util");
|
||||||
|
|
||||||
pub const create = struct {
|
pub const create = struct {
|
||||||
pub const method = .POST;
|
pub const method = .POST;
|
||||||
pub const path = "/notes";
|
pub const path = "/api/v0/notes";
|
||||||
|
|
||||||
pub const Body = struct {
|
pub const Body = struct {
|
||||||
content: []const u8,
|
content: []const u8,
|
||||||
|
@ -18,7 +18,7 @@ pub const create = struct {
|
||||||
|
|
||||||
pub const get = struct {
|
pub const get = struct {
|
||||||
pub const method = .GET;
|
pub const method = .GET;
|
||||||
pub const path = "/notes/:id";
|
pub const path = "/api/v0/notes/:id";
|
||||||
|
|
||||||
pub const Args = struct {
|
pub const Args = struct {
|
||||||
id: util.Uuid,
|
id: util.Uuid,
|
||||||
|
|
|
@ -3,7 +3,7 @@ const std = @import("std");
|
||||||
|
|
||||||
pub const streaming = struct {
|
pub const streaming = struct {
|
||||||
pub const method = .GET;
|
pub const method = .GET;
|
||||||
pub const path = "/streaming";
|
pub const path = "/api/v0/streaming";
|
||||||
|
|
||||||
pub fn handler(req: anytype, response: anytype, _: anytype) !void {
|
pub fn handler(req: anytype, response: anytype, _: anytype) !void {
|
||||||
var iter = req.headers.iterator();
|
var iter = req.headers.iterator();
|
||||||
|
|
|
@ -4,7 +4,7 @@ const controller_utils = @import("../../controllers.zig").helpers;
|
||||||
|
|
||||||
pub const global = struct {
|
pub const global = struct {
|
||||||
pub const method = .GET;
|
pub const method = .GET;
|
||||||
pub const path = "/timelines/global";
|
pub const path = "/api/v0/timelines/global";
|
||||||
|
|
||||||
pub const Query = api.TimelineArgs;
|
pub const Query = api.TimelineArgs;
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ pub const global = struct {
|
||||||
|
|
||||||
pub const local = struct {
|
pub const local = struct {
|
||||||
pub const method = .GET;
|
pub const method = .GET;
|
||||||
pub const path = "/timelines/local";
|
pub const path = "/api/v0/timelines/local";
|
||||||
|
|
||||||
pub const Query = api.TimelineArgs;
|
pub const Query = api.TimelineArgs;
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ pub const local = struct {
|
||||||
|
|
||||||
pub const home = struct {
|
pub const home = struct {
|
||||||
pub const method = .GET;
|
pub const method = .GET;
|
||||||
pub const path = "/timelines/home";
|
pub const path = "/api/v0/timelines/home";
|
||||||
|
|
||||||
pub const Query = api.TimelineArgs;
|
pub const Query = api.TimelineArgs;
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ const api = @import("api");
|
||||||
|
|
||||||
pub const create = struct {
|
pub const create = struct {
|
||||||
pub const method = .POST;
|
pub const method = .POST;
|
||||||
pub const path = "/users";
|
pub const path = "/api/v0/users";
|
||||||
|
|
||||||
pub const Body = struct {
|
pub const Body = struct {
|
||||||
username: []const u8,
|
username: []const u8,
|
||||||
|
|
|
@ -6,7 +6,7 @@ const Uuid = util.Uuid;
|
||||||
|
|
||||||
pub const create = struct {
|
pub const create = struct {
|
||||||
pub const method = .POST;
|
pub const method = .POST;
|
||||||
pub const path = "/users/:id/follow";
|
pub const path = "/api/v0/users/:id/follow";
|
||||||
|
|
||||||
pub const Args = struct {
|
pub const Args = struct {
|
||||||
id: Uuid,
|
id: Uuid,
|
||||||
|
@ -21,7 +21,7 @@ pub const create = struct {
|
||||||
|
|
||||||
pub const query_followers = struct {
|
pub const query_followers = struct {
|
||||||
pub const method = .GET;
|
pub const method = .GET;
|
||||||
pub const path = "/users/:id/followers";
|
pub const path = "/api/v0/users/:id/followers";
|
||||||
|
|
||||||
pub const Args = struct {
|
pub const Args = struct {
|
||||||
id: Uuid,
|
id: Uuid,
|
||||||
|
@ -38,7 +38,7 @@ pub const query_followers = struct {
|
||||||
|
|
||||||
pub const query_following = struct {
|
pub const query_following = struct {
|
||||||
pub const method = .GET;
|
pub const method = .GET;
|
||||||
pub const path = "/users/:id/following";
|
pub const path = "/api/v0/users/:id/following";
|
||||||
|
|
||||||
pub const Args = struct {
|
pub const Args = struct {
|
||||||
id: Uuid,
|
id: Uuid,
|
||||||
|
|
Loading…
Reference in a new issue