Clean up unused code and sync Terraform state
- Remove unused Express server (server.js) - Remove unused API route (src/pages/api/filaments.ts) - Remove Express dependency and related scripts from package.json - Import existing AWS domain association into Terraform - Add domain configuration to terraform.tfvars - Update domain association to include www and dev subdomains - Set wait_for_verification to false to avoid timeouts 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -5,8 +5,6 @@
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"dev:server": "node server.js",
|
||||
"dev:all": "npm run dev:server & npm run dev",
|
||||
"build": "tsc && vite build",
|
||||
"preview": "vite preview",
|
||||
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0"
|
||||
@@ -15,7 +13,6 @@
|
||||
"@types/cheerio": "^0.22.35",
|
||||
"axios": "^1.6.2",
|
||||
"cheerio": "^1.1.0",
|
||||
"express": "^4.18.2",
|
||||
"react": "^18.2.0",
|
||||
"react-dom": "^18.2.0"
|
||||
},
|
||||
|
||||
30
server.js
30
server.js
@@ -1,30 +0,0 @@
|
||||
import express from 'express';
|
||||
import { handler } from './src/pages/api/filaments.js';
|
||||
|
||||
const app = express();
|
||||
const port = 3000;
|
||||
|
||||
app.get('/api/filaments', async (req, res) => {
|
||||
const event = {
|
||||
httpMethod: 'GET',
|
||||
headers: req.headers,
|
||||
queryStringParameters: req.query
|
||||
};
|
||||
|
||||
try {
|
||||
const response = await handler(event);
|
||||
res.status(response.statusCode);
|
||||
|
||||
Object.entries(response.headers || {}).forEach(([key, value]) => {
|
||||
res.setHeader(key, value);
|
||||
});
|
||||
|
||||
res.send(response.body);
|
||||
} catch (error) {
|
||||
res.status(500).json({ error: error.message });
|
||||
}
|
||||
});
|
||||
|
||||
app.listen(port, () => {
|
||||
console.log(`API server running at http://localhost:${port}`);
|
||||
});
|
||||
9
terraform.tfstate
Normal file
9
terraform.tfstate
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"version": 4,
|
||||
"terraform_version": "1.5.7",
|
||||
"serial": 1,
|
||||
"lineage": "6405bb5f-e094-2fa4-339e-33ddd7ca840f",
|
||||
"outputs": {},
|
||||
"resources": [],
|
||||
"check_results": null
|
||||
}
|
||||
@@ -100,8 +100,9 @@ resource "aws_amplify_branch" "dev" {
|
||||
resource "aws_amplify_domain_association" "filamenteka" {
|
||||
count = var.domain_name != "" ? 1 : 0
|
||||
|
||||
app_id = aws_amplify_app.filamenteka.id
|
||||
domain_name = var.domain_name
|
||||
app_id = aws_amplify_app.filamenteka.id
|
||||
domain_name = var.domain_name
|
||||
wait_for_verification = false
|
||||
|
||||
# Map main branch to root domain
|
||||
sub_domain {
|
||||
@@ -109,6 +110,12 @@ resource "aws_amplify_domain_association" "filamenteka" {
|
||||
prefix = ""
|
||||
}
|
||||
|
||||
# Map main branch to www subdomain
|
||||
sub_domain {
|
||||
branch_name = aws_amplify_branch.main.branch_name
|
||||
prefix = "www"
|
||||
}
|
||||
|
||||
# Map dev branch to dev subdomain
|
||||
sub_domain {
|
||||
branch_name = aws_amplify_branch.dev.branch_name
|
||||
|
||||
Reference in New Issue
Block a user