-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
61 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,15 +11,21 @@ | |
"nodeModulesDir": true, | ||
"imports": { | ||
"$fresh/": "https://deno.land/x/[email protected]/", | ||
"preact": "https://esm.sh/[email protected]", | ||
"preact/": "https://esm.sh/[email protected]/", | ||
"preact-render-to-string": "https://esm.sh/*[email protected]", | ||
"$std/": "https://deno.land/[email protected]/", | ||
"@preact/signals": "https://esm.sh/*@preact/[email protected]", | ||
"@preact/signals-core": "https://esm.sh/*@preact/[email protected]", | ||
"@takoserver/takos-database": "jsr:@takoserver/takos-database@^0.1.0", | ||
"preact": "https://esm.sh/[email protected]", | ||
"preact-render-to-string": "https://esm.sh/*[email protected]", | ||
"preact/": "https://esm.sh/[email protected]/", | ||
"tailwindcss": "npm:[email protected]", | ||
"tailwindcss/": "npm:/[email protected]/", | ||
"tailwindcss/plugin": "npm:/[email protected]/plugin.js", | ||
"$std/": "https://deno.land/[email protected]/" | ||
"tailwindcss/plugin": "npm:/[email protected]/plugin.js" | ||
}, | ||
"alias": { | ||
"react": "preact/compat", | ||
"react-dom/test-utils": "preact/test-utils", | ||
"react-dom": "preact/compat" | ||
}, | ||
"compilerOptions": { "jsx": "react-jsx", "jsxImportSource": "preact" }, | ||
"exclude": ["**/_fresh/*"] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,16 @@ import config from "./fresh.config.ts"; | |
|
||
import "$std/dotenv/load.ts"; | ||
|
||
import { envRoader } from "./util/takoFunction.ts"; | ||
/**connect mongoDB */ | ||
import mongoose from "npm:[email protected]"; | ||
/* | ||
try { | ||
mongoose.connect( | ||
`mongodb://192.168.0.30:27017/takos` | ||
) | ||
} catch (error) { | ||
console.log(error) | ||
}*/ | ||
await dev(import.meta.url, "./main.ts", config); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
FROM denoland/deno:1.38.3 | ||
|
||
ARG GIT_REVISION | ||
ENV DENO_DEPLOYMENT_ID=${GIT_REVISION} | ||
|
||
WORKDIR /app | ||
|
||
COPY . . | ||
RUN deno cache main.ts | ||
|
||
EXPOSE 8000 | ||
|
||
CMD ["run", "-A", "main.ts"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,15 @@ | ||
import { h } from 'preact'; | ||
import { useState } from 'preact/hooks'; | ||
|
||
|
||
const App = () => { | ||
const [showModal, setShowModal] = useState(false); | ||
|
||
const handleButtonClick = () => { | ||
setShowModal(!showModal); | ||
} | ||
const MyForm = () => { | ||
|
||
return ( | ||
<div className="App"> | ||
<button onClick={handleButtonClick}> | ||
ボタン | ||
</button> | ||
|
||
{showModal && ( | ||
<div className="modal"> | ||
<div className="modal-content"> | ||
<span className="close" onClick={handleButtonClick}>×</span> | ||
<p>ここにフォームを追加します</p> | ||
</div> | ||
</div> | ||
)} | ||
</div> | ||
<form onSubmit={handleSubmit(onSubmit)}> | ||
<input {...register("firstName")} /> | ||
<input {...register("lastName")} /> | ||
{errors.lastName && <p>{errors.lastName.message}</p>} | ||
<button type="submit">Submit</button> | ||
</form> | ||
); | ||
} | ||
}; | ||
|
||
export default App; | ||
export default MyForm; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ import { Client } from "https://deno.land/x/[email protected]/mod.ts"; | |
import { isMail, isUserDuplication, isMailDuplication, isMailDuplicationTemp, isCsrftoken, sendMail,client} from "../../../util/takoFunction.ts"; | ||
|
||
export const handler = { | ||
async POST(req) { | ||
async POST(req,res, ctx) { | ||
const data = await req.json(); | ||
const email = await data.mail; | ||
const CsrfToken = await data.csrftoken; | ||
|
@@ -26,9 +26,10 @@ export const handler = { | |
} | ||
client.query(`INSERT INTO temp_users (id,created_at,mail, kye) VALUES (default,default,"${email}",'${key}');`) | ||
sendMail(email,"本登録を完了してください",`https://takos.jp/register?key=${key}`) | ||
/* | ||
return new Response(JSON.stringify({status: true}), { | ||
headers: { "Content-Type": "application/json" }, | ||
}); | ||
});*/ | ||
} catch (error) { | ||
return new Response(JSON.stringify({"status": "error"}), { | ||
headers: { "Content-Type": "application/json" }, | ||
|
@@ -40,9 +41,10 @@ export const handler = { | |
}); | ||
} | ||
}else { | ||
return new Response(JSON.stringify({"status": "error"}), { | ||
ctx.status(403).send({"status": "error"}) | ||
/*return new Response(JSON.stringify({"status": "error"}), { | ||
headers: { "Content-Type": "application/json" }, | ||
}); | ||
});*/ | ||
} | ||
} else { | ||
return new Response(JSON.stringify({"status": "error"}), { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,8 @@ | ||
import React, { useState } from "preact/compat"; | ||
|
||
const Form = () => { | ||
const [inputValue, setInputValue] = useState(""); | ||
const [submittedValue, setSubmittedValue] = useState(""); | ||
|
||
const handleSubmit = (event: React.FormEvent<HTMLFormElement>) => { | ||
event.preventDefault(); | ||
setSubmittedValue(inputValue); | ||
setInputValue(""); | ||
}; | ||
|
||
const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => { | ||
setInputValue(event.target.value); | ||
}; | ||
|
||
return ( | ||
<div> | ||
<form onSubmit={handleSubmit}> | ||
<label> | ||
Input: | ||
<input type="text" value={inputValue} onChange={handleChange} /> | ||
</label> | ||
<button type="submit">Submit</button> | ||
</form> | ||
{submittedValue && <p>Submitted Value: {submittedValue}</p>} | ||
</div> | ||
); | ||
}; | ||
|
||
export default Form; | ||
// deno-lint-ignore-file | ||
import Test from "../../islands/test.jsx"; | ||
export default function name() { | ||
return <> | ||
<Test></Test> | ||
<div>test</div> | ||
</> | ||
} |
Empty file.