Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
WilcoApp committed Feb 14, 2024
1 parent ddc7a54 commit 279d66f
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
7 changes: 6 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
{
"name": "Anythink Development Container",
"image": "public.ecr.aws/v0a2l7y2/wilco/anythink-devcontainer:latest"
"image": "public.ecr.aws/v0a2l7y2/wilco/anythink-devcontainer:latest",
"customizations": {
"vscode": {
"extensions": ["GitHub.copilot", "GitHub.copilot-chat"]
}
}
}
6 changes: 2 additions & 4 deletions .devcontainer/setup.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
WILCO_ID="`cat .wilco`"
ENGINE_EVENT_ENDPOINT="${ENGINE_BASE_URL}/users/${WILCO_ID}/event"
CODESPACE_BACKEND_HOST=$(curl -s "${ENGINE_BASE_URL}/api/v1/codespace/backendHost?codespaceName=${CODESPACE_NAME}&portForwarding=${GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN}" | jq -r '.codespaceBackendHost')
CODESPACE_BACKEND_URL="https://${CODESPACE_BACKEND_HOST}"
export ENGINE_EVENT_ENDPOINT="${ENGINE_BASE_URL}/users/${WILCO_ID}/event"

# Update engine that codespace started for user
curl -L -X POST "${ENGINE_EVENT_ENDPOINT}" -H "Content-Type: application/json" --data-raw "{ \"event\": \"github_codespace_started\" }"
Expand All @@ -10,11 +10,9 @@ curl -L -X POST "${ENGINE_EVENT_ENDPOINT}" -H "Content-Type: application/json" -
echo "export CODESPACE_BACKEND_HOST=\"${CODESPACE_BACKEND_HOST}\"" >> ~/.bashrc
echo "export CODESPACE_BACKEND_URL=\"${CODESPACE_BACKEND_URL}\"" >> ~/.bashrc
echo "export CODESPACE_WDS_SOCKET_PORT=443" >> ~/.bashrc
echo "export ENGINE_EVENT_ENDPOINT=\"${ENGINE_EVENT_ENDPOINT}\"" >> ~/.bashrc


# Export welcome prompt in bash:
echo "printf \"\n\n☁️☁️☁️️ Anythink: Develop in the Cloud ☁️☁️☁️\n\"" >> ~/.bashrc
echo "printf \"\n\x1b[31m \x1b[1m👉 Type: \\\`docker compose up\\\` to run the project. 👈\n\n\"" >> ~/.bashrc

nohup bash -c 'cd /wilco-agent && node agent.js &' > /dev/null 2>&1
nohup bash -c "cd /wilco-agent && node agent.js &" >> /tmp/agent.log 2>&1
5 changes: 5 additions & 0 deletions backend/routes/api/comments.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const router = require("express").Router();
const mongoose = require("mongoose");
const Comment = mongoose.model("Comment");

module.exports = router;
1 change: 1 addition & 0 deletions backend/routes/api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ router.use('/', require('./users'));
router.use('/profiles', require('./profiles'));
router.use('/items', require('./items'));
router.use('/tags', require('./tags'));
router.use('/comments', require('./comments'));
router.use('/ping', require('./ping'));

router.use(function(err, req, res, next){
Expand Down

0 comments on commit 279d66f

Please sign in to comment.