Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions bits/postgres-typeorm/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.encore
encore.gen.go
encore.gen.cue
/.encore
node_modules
/encore.gen
40 changes: 40 additions & 0 deletions bits/postgres-typeorm/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Encore TS with Postgres + TypeORM

## Prerequisites

You should have an instance of Postgres database running.

## Running locally

```bash
npm install
encore run
```

While `encore run` is running, open <http://localhost:9400/> to view Encore's [local developer dashboard](https://encore.dev/docs/observability/dev-dash).

## Using the API

POST shorten any url

```bash
curl 'http://localhost:4000/url' -d '{"url":"https://google.com"}'
```

GET all urls in the database

```bash
curl 'http://localhost:4000/urls'
```

GET url by shortened id

```bash
curl 'http://localhost:4000/url/:id'
```

## Testing

```bash
encore test
```
6 changes: 6 additions & 0 deletions bits/postgres-typeorm/encore.app
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
// The app is not currently linked to the encore.dev platform.
// Use "encore app link" to link it.
"id": "",
"lang": "typescript",
}
Loading