Skip to content

Commit d030702

Browse files
committed
fix: public
1 parent e58a6ac commit d030702

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

public/test.html

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<!-- Testing automatic serving of files from the 'public/' directory -->

src/app.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ await test('createApp', async (t) => {
6767
const arr: Test[] = [
6868
// Static
6969
{ method: 'GET', url: '/', statusCode: 200 },
70-
{ method: 'GET', url: '/output.css', statusCode: 200 },
70+
{ method: 'GET', url: '/test.html', statusCode: 200 },
7171
{ method: 'GET', url: `/${file}`, statusCode: 200 },
7272

7373
// CORS

src/app.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export function createApp(db: Low<Data>, options: AppOptions = {}) {
3131
const app = new App()
3232

3333
// Static files
34-
app.use(sirv(join(__dirname, '../public'), { dev: !isProduction }))
34+
app.use(sirv('public', { dev: !isProduction }))
3535
options.static
3636
?.map((path) => (isAbsolute(path) ? path : join(process.cwd(), path)))
3737
.forEach((dir) => app.use(sirv(dir, { dev: !isProduction })))

0 commit comments

Comments
 (0)