File tree Expand file tree Collapse file tree 3 files changed +11
-11
lines changed Expand file tree Collapse file tree 3 files changed +11
-11
lines changed Original file line number Diff line number Diff line change 1
1
import { Elysia } from 'elysia'
2
- import cors from '../src/index'
2
+ import { cors } from '../src/index'
3
3
4
4
const app = new Elysia ( )
5
- . use ( cors ( {
6
- maxAge : 5
7
- } ) )
8
- . get ( '/' , ( ) => ( {
9
- hello : 'world'
10
- } ) )
11
- . post ( '/' , ( ) => 'Hi' )
12
- . listen ( 8080 )
5
+ . use ( cors ( ) )
6
+ . get ( '/' , ( ) => ( { same : 'a' } ) )
7
+ . listen ( 3000 )
8
+
9
+ console . log ( `Elysia is running at ${ app . server ?. hostname } : ${ app . server ?. port } ` )
10
+
11
+ export type App = typeof app
12
+ console . log ( 'Server is running on port 3000.' )
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @elysiajs/cors" ,
3
- "version" : " 0.5.0 " ,
3
+ "version" : " 0.5.1 " ,
4
4
"description" : " Plugin for Elysia that for Cross Origin Requests (CORs)" ,
5
5
"author" : {
6
6
"name" : " saltyAom" ,
43
43
"peerDependencies" : {
44
44
"elysia" : " >= 0.5.12"
45
45
}
46
- }
46
+ }
You can’t perform that action at this time.
0 commit comments