Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf08998d

Browse files
committed
2 parentse74fad7 +46a83e9 commitf08998d

File tree

4 files changed

+89
-0
lines changed

4 files changed

+89
-0
lines changed

‎backend/.dockerignore‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/.git
2+
/node_modules
3+
.dockerignore
4+
.env
5+
Dockerfile
6+
fly.toml

‎backend/Dockerfile‎

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# syntax = docker/dockerfile:1
2+
3+
# Adjust NODE_VERSION as desired
4+
ARG NODE_VERSION=20.18.0
5+
FROM node:${NODE_VERSION}-slim AS base
6+
7+
LABEL fly_launch_runtime="Node.js"
8+
9+
# Node.js app lives here
10+
WORKDIR /app
11+
12+
# Set production environment
13+
ENV NODE_ENV="production"
14+
15+
16+
# Throw-away build stage to reduce size of final image
17+
FROM base AS build
18+
19+
# Install packages needed to build node modules
20+
RUN apt-get update -qq && \
21+
apt-get install --no-install-recommends -y build-essential node-gyp pkg-config python-is-python3
22+
23+
# Install node modules
24+
COPY package-lock.json package.json ./
25+
RUN npm ci --include=dev
26+
27+
# Copy application code
28+
COPY . .
29+
30+
# Build application
31+
RUN npm run build
32+
33+
# Remove development dependencies
34+
RUN npm prune --omit=dev
35+
36+
37+
# Final stage for app image
38+
FROM base
39+
40+
# Copy built application
41+
COPY --from=build /app /app
42+
43+
# Start the server by default, this can be overwritten at runtime
44+
EXPOSE 3000
45+
CMD ["npm","run","start" ]

‎backend/fly.toml‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# fly.toml app configuration file generated for quicksnip on 2025-07-02T13:29:43Z
2+
#
3+
# See https://fly.io/docs/reference/configuration/ for information about how to use this file.
4+
#
5+
6+
app ='quicksnip'
7+
primary_region ='arn'
8+
9+
[build]
10+
11+
[http_service]
12+
internal_port =3000
13+
force_https =true
14+
auto_stop_machines ='stop'
15+
auto_start_machines =true
16+
min_machines_running =0
17+
processes = ['app']
18+
19+
[[vm]]
20+
memory ='1gb'
21+
cpu_kind ='shared'
22+
cpus =1
23+
memory_mb =1024

‎backend/index.ts‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,21 @@ app.get("/languages", (_req, res) => {
4848
return;
4949
});
5050

51+
// Get all content (consolidated file) for language
52+
app.get("/languages/:language",(req,res)=>{
53+
const{ language}=req.params;
54+
55+
constfile=path.join(dataDir,`consolidated/${language}.json`);
56+
constjson=readJSON(file);
57+
if(!json){
58+
res.status(404).json({error:"Language file not found"});
59+
return;
60+
}
61+
62+
res.json(json);
63+
return;
64+
});
65+
5166
// Get all categories for a given language
5267
app.get("/categories/:language",(req,res)=>{
5368
const{ language}=req.params;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp