fix(core): update
This commit is contained in:
@ -1,12 +1,12 @@
|
||||
import { expect, expectAsync, tap } from '@pushrocks/tapbundle';
|
||||
import { expect, expectAsync, tap } from '@push.rocks/tapbundle';
|
||||
import * as smartguard from '../ts/index.js';
|
||||
import * as smartexpress from '@pushrocks/smartexpress';
|
||||
import * as smartrequest from '@pushrocks/smartrequest';
|
||||
import * as typedserver from '@api.global/typedserver';
|
||||
import * as smartrequest from '@push.rocks/smartrequest';
|
||||
|
||||
let smartexpressInstance: smartexpress.Server;
|
||||
let smartexpressInstance: typedserver.servertools.Server;
|
||||
|
||||
tap.test('should create a demo smartexpress instance', async () => {
|
||||
smartexpressInstance = new smartexpress.Server({
|
||||
smartexpressInstance = new typedserver.servertools.Server({
|
||||
cors: true,
|
||||
forceSsl: false,
|
||||
defaultAnswer: async () => 'hi there',
|
||||
@ -16,8 +16,8 @@ tap.test('should create a demo smartexpress instance', async () => {
|
||||
|
||||
tap.test('should be able to create smartguards for a request', async () => {
|
||||
interface IRequestGuardData {
|
||||
req: smartexpress.Request;
|
||||
res: smartexpress.Response;
|
||||
req: typedserver.Request;
|
||||
res: typedserver.Response;
|
||||
}
|
||||
const ipGuard = new smartguard.Guard<IRequestGuardData>(async (dataArg) => {
|
||||
console.log('executing ip guard');
|
||||
@ -32,7 +32,7 @@ tap.test('should be able to create smartguards for a request', async () => {
|
||||
|
||||
smartexpressInstance.addRoute(
|
||||
'/testroute',
|
||||
new smartexpress.Handler('ALL', async (req, res) => {
|
||||
new typedserver.servertools.Handler('ALL', async (req, res) => {
|
||||
await smartguard.passGuards(
|
||||
{
|
||||
req,
|
||||
|
Reference in New Issue
Block a user