mirror of
https://git.sr.ht/~roxwize/mipilin
synced 2025-01-31 02:53:36 +00:00
compilation
Signed-off-by: roxwize <rae@roxwize.xyz>
This commit is contained in:
parent
dfd27154cd
commit
a2e568e751
5 changed files with 79 additions and 45 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,2 +1,3 @@
|
||||||
node_modules/
|
node_modules/
|
||||||
|
dist/
|
||||||
.env
|
.env
|
||||||
|
|
29
README.md
29
README.md
|
@ -6,3 +6,32 @@
|
||||||
mipilin **mipilin**
|
mipilin **mipilin**
|
||||||
|
|
||||||
![website screenshot](./screenshot.png)
|
![website screenshot](./screenshot.png)
|
||||||
|
|
||||||
|
## Running locally
|
||||||
|
|
||||||
|
```sh
|
||||||
|
## get repository
|
||||||
|
git clone https://git.sr.ht/~roxwize/mipilin
|
||||||
|
cd mipilin
|
||||||
|
|
||||||
|
## setup environment variables
|
||||||
|
cp .env.example .env
|
||||||
|
$EDITOR .env # If $EDITOR is not set, replace it with your text editor of choice
|
||||||
|
|
||||||
|
## start server
|
||||||
|
pnpm install
|
||||||
|
pnpm build # Compile TypeScript files to JavaScript in ./dist/
|
||||||
|
pnpm start
|
||||||
|
```
|
||||||
|
|
||||||
|
You can also run the server's TypeScript directly by using `pnpm dev`.
|
||||||
|
|
||||||
|
### Environment variables
|
||||||
|
|
||||||
|
Keep your `.env` file to yourself. The only non-sensitive field is `LISTEN_ON_SOCKET`.
|
||||||
|
|
||||||
|
| Variable | Description | Required |
|
||||||
|
| -------- | ----------- | -------- |
|
||||||
|
| `LISTEN_ON_SOCKET` | If set to `true` the server will run on a Unix socket at `/run/user/[UUID]/mipilin/mipilin.sock` | no |
|
||||||
|
| `DATABASE_URL` | URL where your PostgresQL database will be accessed | **yes** |
|
||||||
|
| `COOKIE_SECRET` | Can be any string, used to sign cookies | **yes** |
|
||||||
|
|
2
main.ts
2
main.ts
|
@ -137,7 +137,7 @@ object-src 'none'; base-uri 'none';"
|
||||||
|
|
||||||
const path = process.env.LISTEN_ON_SOCKET === "true" ? `/run/user/${process.getuid()}/mipilin/mipilin.sock` : 1337;
|
const path = process.env.LISTEN_ON_SOCKET === "true" ? `/run/user/${process.getuid()}/mipilin/mipilin.sock` : 1337;
|
||||||
app.listen(path, () => {
|
app.listen(path, () => {
|
||||||
console.log(`mipilin is now listening on ${path}!! Requests will be printed below. Good Luck`);
|
console.log(`mipilin is now listening on ${typeof path === "number" ? "https://127.0.0.1:" + path + "/" : path}!! Requests will be printed below. Good Luck`);
|
||||||
});
|
});
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,9 @@
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "main.ts",
|
"main": "main.ts",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "tsx main.ts"
|
"build": "tsc",
|
||||||
|
"start": "node dist/main.js",
|
||||||
|
"dev": "tsx main.ts"
|
||||||
},
|
},
|
||||||
"keywords": [],
|
"keywords": [],
|
||||||
"author": "",
|
"author": "",
|
||||||
|
|
|
@ -4,6 +4,8 @@
|
||||||
"target": "ES6",
|
"target": "ES6",
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
"moduleResolution": "NodeNext",
|
"moduleResolution": "NodeNext",
|
||||||
"module": "NodeNext"
|
"module": "NodeNext",
|
||||||
}
|
"outDir": "dist/"
|
||||||
|
},
|
||||||
|
"exclude": ["node_modules/", "drizzle.config.ts"]
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue