-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Added an express template to @sei-js/create-sei for an actions API using express
- Loading branch information
1 parent
10ed031
commit 0428698
Showing
21 changed files
with
3,431 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Environment Configuration | ||
NODE_ENV="development" # Options: 'development', 'production' | ||
PORT="8000" # The port your server will listen on | ||
HOST="localhost" # Hostname for the server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
v22 |
31 changes: 31 additions & 0 deletions
31
packages/create-sei/templates/express-action-template/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# 🚀 Actions API using Express and TypeScript | ||
|
||
## Setup | ||
To install the dependencies required to run this project, run the following command: | ||
```bash | ||
yarn install | ||
``` | ||
|
||
## Developing | ||
To run the development server on the port defined in the `.env` file, run the following command: | ||
```bash | ||
yarn dev | ||
``` | ||
|
||
## Testing | ||
To run the tests with vitest, run the following command: | ||
```bash | ||
yarn test | ||
``` | ||
|
||
## Building | ||
To build the project, run the following command: | ||
```bash | ||
yarn build | ||
``` | ||
|
||
## Serving | ||
To serve the built project, run the following command: | ||
```bash | ||
yarn serve | ||
``` |
25 changes: 25 additions & 0 deletions
25
packages/create-sei/templates/express-action-template/biome.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json", | ||
"formatter": { | ||
"indentStyle": "space", | ||
"lineWidth": 120 | ||
}, | ||
"organizeImports": { "enabled": true }, | ||
"linter": { | ||
"enabled": true, | ||
"rules": { | ||
"recommended": true, | ||
"suspicious": { | ||
"noExplicitAny": "off", | ||
"noConfusingVoidType": "off" | ||
}, | ||
"style": { | ||
"noUselessElse": "off", | ||
"noNonNullAssertion": "off" | ||
}, | ||
"complexity": { | ||
"noForEach": "off" | ||
} | ||
} | ||
} | ||
} |
49 changes: 49 additions & 0 deletions
49
packages/create-sei/templates/express-action-template/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
{ | ||
"name": "express-action-template", | ||
"version": "1.0.0", | ||
"description": "An Express boilerplate for a Sei action API written in Typescript", | ||
"repository": "sei-protocol/sei-js", | ||
"license": "MIT", | ||
"main": "index.ts", | ||
"private": true, | ||
"scripts": { | ||
"dev": "tsx watch --clear-screen=false src/index.ts", | ||
"build": "tsup", | ||
"start": "node dist/index.js", | ||
"clean": "rimraf dist coverage", | ||
"check": "biome check src/", | ||
"fix": "biome check src/ --fix", | ||
"format": "biome format src/ --fix", | ||
"test": "vitest run" | ||
}, | ||
"dependencies": { | ||
"@sei-js/actions": "^1.0.0", | ||
"cors": "^2.8.5", | ||
"dotenv": "^16.4.5", | ||
"express": "^4.19.2", | ||
"helmet": "^7.1.0", | ||
"http-status-codes": "^2.3.0" | ||
}, | ||
"devDependencies": { | ||
"@biomejs/biome": "1.8.3", | ||
"@types/cors": "^2.8.17", | ||
"@types/express": "^4.17.21", | ||
"@types/supertest": "^6.0.2", | ||
"lint-staged": "^15.2.2", | ||
"rimraf": "^6.0.0", | ||
"supertest": "^7.0.0", | ||
"tsup": "^8.0.2", | ||
"tsx": "^4.7.2", | ||
"typescript": "^5.4.4", | ||
"vitest": "^2.0.0" | ||
}, | ||
"lint-staged": { | ||
"*.{js,ts,cjs,mjs,d.cts,d.mts,json,jsonc}": ["biome check --apply --no-errors-on-unmatched"] | ||
}, | ||
"tsup": { | ||
"entry": ["src", "!src/**/__tests__/**", "!src/**/*.test.*"], | ||
"splitting": false, | ||
"sourcemap": true, | ||
"clean": true | ||
} | ||
} |
Oops, something went wrong.