Skip to content

Commit

Permalink
fix(devcontainer): Add build-libraries step (#443)
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperVK authored and JustSamuel committed Nov 8, 2024
1 parent 489d2c1 commit 02bb451
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 15 deletions.
4 changes: 3 additions & 1 deletion .devcontainer/postCreateCommands.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@ yarn install

#Copy .env files
cp apps/dashboard/.env.example apps/dashboard/.env
cp apps/point-of-sale/.env.example apps/point-of-sale/.env
cp apps/point-of-sale/.env.example apps/point-of-sale/.env

yarn build-libraries
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ You can quickly start development directly in your browser by using [Codespaces]
#### Step 1: Installing
- Use git to [clone](https://github.com/git-guides#how-do-i-use-git) the repository.
- Run `yarn install`
- Copy the .env.example file to .env in the `apps/dashboard` and `apps/point-of-sale` directories
- Copy the `.env.example` file to `.env` file in the `apps/dashboard` and `apps/point-of-sale` directories
- Run `yarn build-libraries` to have the SudoSOS libraries also ready

#### Step 2: Running the dashboard/point-of-sale
- Run `yarn dev-dashboard` or `yarn dev-pos` to start the development environment.
Expand Down
6 changes: 4 additions & 2 deletions apps/point-of-sale/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@ app.component('Toast', Toast);
app.use(createPinia());
app.mount('#app');

const baseURL = window.location.pathname.split('/')[1] || '';
window.__BASE_URL__ = `/${baseURL}/`;
const basePath = window.location.pathname.split('/')[1] || '';
const base = document.createElement('base');
base.href = `/${basePath}/`;
document.head.appendChild(base);

// Refresh alcohol time every hour.
setInterval(() => {
Expand Down
7 changes: 0 additions & 7 deletions apps/point-of-sale/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,6 @@ export default defineConfig(({ mode }) => {

return {
base: "./",
experimental: {
renderBuiltUrl(filename) {
return {
runtime: `window.__BASE_URL__ + ${JSON.stringify(filename)}`
};
},
},
plugins: [
vue(),
],
Expand Down
9 changes: 5 additions & 4 deletions lib/nginx/default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ upstream frontend {
server frontend:80;
}

upstream frontend {
server pos:80;
}

upstream backend {
server backend:80;
}
Expand All @@ -29,6 +25,11 @@ server {
proxy_pass http://pos/;
}

# Add a new location for pos-develop with sub_filter
location /pos-develop/ {
proxy_pass http://pos-develop/;
}

location /docs/ {
proxy_pass http://docs/;
}
Expand Down

0 comments on commit 02bb451

Please sign in to comment.