Browse Source

Update routes, package dependency declaration

Use /api/draw for the routes, and use link: for defining core
dependency.
master
TheoryOfNekomata 1 year ago
parent
commit
0876380083
4 changed files with 5 additions and 5 deletions
  1. +1
    -1
      package.json
  2. +2
    -2
      src/__tests__/index.test.ts
  3. +1
    -1
      src/routes.ts
  4. +1
    -1
      tsconfig.json

+ 1
- 1
package.json View File

@@ -59,7 +59,7 @@
}, },
"dependencies": { "dependencies": {
"fastify": "^3.27.0", "fastify": "^3.27.0",
"@modal-sh/oblique-strategies-core": "file:../core"
"@modal-sh/oblique-strategies-core": "link:../core"
}, },
"scripts": { "scripts": {
"prepublishOnly": "pridepack clean && pridepack build", "prepublishOnly": "pridepack clean && pridepack build",


+ 2
- 2
src/__tests__/index.test.ts View File

@@ -27,7 +27,7 @@ describe('Example', () => {
it('draws a card from default set', async () => { it('draws a card from default set', async () => {
const response = await server const response = await server
.inject() .inject()
.post('/')
.post('/api/draw')
.headers({ .headers({
Accept: 'text/plain', Accept: 'text/plain',
}); });
@@ -39,7 +39,7 @@ describe('Example', () => {
it('draws a card from custom sets', async () => { it('draws a card from custom sets', async () => {
const response = await server const response = await server
.inject() .inject()
.post('/')
.post('/api/draw')
.query({ .query({
cards: ['default', 'text:hello|world'], cards: ['default', 'text:hello|world'],
}) })


+ 1
- 1
src/routes.ts View File

@@ -6,7 +6,7 @@ export const addRoutes = (server: FastifyInstance) => {


server.route({ server.route({
method: 'POST', method: 'POST',
url: '/',
url: '/api/draw',
handler: cardController.generate, handler: cardController.generate,
}); });
}; };

+ 1
- 1
tsconfig.json View File

@@ -3,7 +3,7 @@
"include": ["src", "types"], "include": ["src", "types"],
"compilerOptions": { "compilerOptions": {
"module": "ESNext", "module": "ESNext",
"lib": ["ESNext"],
"lib": ["DOM","ESNext"],
"importHelpers": true, "importHelpers": true,
"declaration": true, "declaration": true,
"sourceMap": true, "sourceMap": true,


Loading…
Cancel
Save