mirror of
https://github.com/djdevin/recflare.git
synced 2026-09-08 22:51:30 -07:00
add more endpoints
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import { exports } from 'cloudflare:workers'
|
||||
import { describe, expect, test } from 'vitest'
|
||||
|
||||
import '../../ns.app'
|
||||
|
||||
const ORIGIN = 'https://ns.rec.djdevin.net'
|
||||
|
||||
describe('ns endpoints', () => {
|
||||
test('GET / returns the endpoints document', async () => {
|
||||
const res = await exports.default.fetch(`${ORIGIN}/`)
|
||||
expect(res.status).toBe(200)
|
||||
const body = (await res.json()) as Record<string, string>
|
||||
expect(body.API).toBe('https://api.rec.djdevin.net')
|
||||
expect(body.Notifications).toBe('https://notify.rec.djdevin.net')
|
||||
expect(body.Econ).toBe('https://econ.rec.djdevin.net')
|
||||
})
|
||||
|
||||
test('unknown path returns 404', async () => {
|
||||
const res = await exports.default.fetch(`${ORIGIN}/nope`)
|
||||
expect(res.status).toBe(404)
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user