Skip to content

Commit 38fe23b

Browse files
authored
add simple e2e test that enabled worker pooling (#2096)
Just to make sure an app will start with this setting enabled
1 parent 06db564 commit 38fe23b

File tree

1 file changed

+74
-0
lines changed

1 file changed

+74
-0
lines changed
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
run
2+
call GET /hello/world ''
3+
checkresp '{"message": "Hello world"}'
4+
shutdown
5+
6+
-- encore.app --
7+
{
8+
"lang": "typescript",
9+
"build": {
10+
"worker_pooling": true
11+
}
12+
}
13+
14+
-- package.json --
15+
{
16+
"name": "encore-ts-testapp",
17+
"private": true,
18+
"version": "0.0.1",
19+
"description": "Encore Typescript Test app",
20+
"license": "MPL-2.0",
21+
"type": "module",
22+
"scripts": {
23+
"test": "vitest"
24+
},
25+
"devDependencies": {
26+
"@types/node": "^22.5.7",
27+
"typescript": "^5.4",
28+
"vitest": "^3.1.3"
29+
},
30+
"dependencies": {
31+
"encore.dev": "1.50.0"
32+
},
33+
"optionalDependencies": {
34+
"@rollup/rollup-linux-x64-gnu": "^4.13.0"
35+
}
36+
}
37+
38+
-- tsconfig.json --
39+
{
40+
"$schema": "https://json.schemastore.org/tsconfig",
41+
"compilerOptions": {
42+
"lib": ["ES2022"],
43+
"target": "ES2022",
44+
"module": "ES2022",
45+
"types": ["node"],
46+
"paths": {
47+
"~encore/*": ["./encore.gen/*"]
48+
},
49+
"composite": true,
50+
"strict": true,
51+
"moduleResolution": "bundler",
52+
"allowSyntheticDefaultImports": true,
53+
"isolatedModules": true,
54+
"sourceMap": true,
55+
"declaration": true,
56+
"forceConsistentCasingInFileNames": true,
57+
"skipLibCheck": true
58+
}
59+
}
60+
61+
-- myservice/encore.service.ts --
62+
import { Service } from "encore.dev/service";
63+
64+
export default new Service("myservice");
65+
66+
-- myservice/api.ts --
67+
import { api } from "encore.dev/api";
68+
69+
export const hello = api(
70+
{ expose: true, method: "GET", path: "/hello/:name" },
71+
async ({ name }: { name: string }): Promise<{ message: string }> => {
72+
return { message: `Hello ${name}` };
73+
}
74+
);

0 commit comments

Comments
 (0)