Skip to content

Commit

Permalink
Update package.json version and add test files
Browse files Browse the repository at this point in the history
  • Loading branch information
DanPlayz0 committed Dec 21, 2023
1 parent e5c6f3d commit 8816a72
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ashmwtech/dapir",
"version": "1.0.3",
"version": "1.0.4",
"type": "module",
"description": "An api wrapper",
"source": "src/index.ts",
Expand Down Expand Up @@ -30,7 +30,6 @@
"prettier": "^3.1.1"
},
"scripts": {
"dev": "nodemon --swc --files src/index.ts",
"build": "microbundle"
},
"author": "DanPlayz0",
Expand Down
7 changes: 4 additions & 3 deletions test/hello.ts → test/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Server, HTTPContext } from '../src';
process.chdir(__dirname);
import { Server, HTTPContext } from '../src/index';

const context = {
test: 'test',
Expand All @@ -13,12 +14,12 @@ const api = new Server<typeof context>({
},
routes: {
enabled: true,
folder: 'test/routes',
folder: './routes',
context: context,
documentation: {
enabled: true,
path: '/docs',
private_key: 'asdsada',
private_key: 'yes',
},
},
websocket: {
Expand Down
6 changes: 3 additions & 3 deletions test/example.ts → test/routes/get.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { RouteConfig } from '../src';
import type { RouteHandler } from './hello';
import type { RouteConfig } from '../../src';
import type { RouteHandler } from '../index';

export const handler: RouteHandler = (ctx) => ctx.res.json({ message: 'Hey! Go to the site... not the api...' });
export const handler: RouteHandler = (ctx) => ctx.res.json({ message: 'Hey! Go to the docs... not the api root...' });

export const configuration: RouteConfig = {
enabled: true,
Expand Down

0 comments on commit 8816a72

Please sign in to comment.