Skip to content

Commit 26f1522

Browse files
Add TS introduction app (#156)
* Add TS introduction app * Add empty foo.ts file * Add vite.config.js * Update cli-templates.json
1 parent 794dd46 commit 26f1522

File tree

12 files changed

+1697
-0
lines changed

12 files changed

+1697
-0
lines changed

cli-templates.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@
77
"template": "hello-world",
88
"lang": "go"
99
},
10+
{
11+
"title": "Intro to Encore.ts",
12+
"desc": "An interactive tutorial",
13+
"template": "ts/introduction",
14+
"lang": "ts"
15+
},
1016
{
1117
"title": "Hello World",
1218
"desc": "A simple REST API",

ts/introduction/.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.encore
2+
encore.gen.go
3+
encore.gen.cue
4+
/.encore
5+
node_modules
6+
/encore.gen

ts/introduction/README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Encore.ts Introduction
2+
3+
Follow the interactive lessons in the local development dashboard to help you get started with Encore.ts.
4+
5+
## Run the introduction
6+
7+
### Prerequisite: Installing Encore
8+
9+
If this is the first time you're using Encore, you first need to install the CLI that runs the local development
10+
environment. Use the appropriate command for your system:
11+
12+
- **macOS:** `brew install encoredev/tap/encore`
13+
- **Linux:** `curl -L https://encore.dev/install.sh | bash`
14+
- **Windows:** `iwr https://encore.dev/install.ps1 | iex`
15+
16+
When you have installed Encore, run:
17+
18+
```bash
19+
encore app create --example=ts/introduction
20+
```
21+
22+
## Running locally
23+
```bash
24+
encore run
25+
```
26+
27+
While `encore run` is running, open <http://localhost:9400/> to view Encore's [local developer dashboard](https://encore.dev/docs/observability/dev-dash) which for this app also includes an Introduction section. Complete lessons by writing code in your editor to extend the app and finish tasks that will help you master Encore.ts.

ts/introduction/encore.app

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"id": "",
3+
"lang": "typescript"
4+
}

ts/introduction/foo/foo.ts

Whitespace-only changes.

ts/introduction/hello/auth.ts

Whitespace-only changes.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { Service } from "encore.dev/service";
2+
3+
// Encore will consider this directory and all its subdirectories as part of the "hello" service.
4+
// https://encore.dev/docs/ts/primitives/services
5+
export default new Service("hello");

ts/introduction/hello/hello.ts

Whitespace-only changes.

0 commit comments

Comments
 (0)