Skip to main content
Module

x/fastro/cli/messages.ts

Fast and simple web application framework for deno
Go to Latest
File
import { version } from "../mod.ts";
export const default_msg = `fastro: try 'fastro --help' for more information`;export const help_msg = `Usage: fastro [commands] [options]
Commands: init [options] create fastro.json & default handler serve [options] run server with default port (3000) createHandler [options] create handler Options: --help show manual --version show version
try 'fastro [command] --help' for detail information about specific command`;
export const serve_msg = `Usage: fastro serve [options]
Options: --port : custom port
Example: fastro serve --port 5000`;
export const register_msg = `Usage: fastro register [options]
Options: --email : your email
Example: fastro register --email your@email.com`;
export const email_msg = `Error: email empty!
${register_msg}`;
export const deploy_msg = `Usage: fastro deploy`;
export const init_msg = `Usage: fastro init [option]
Options --app : your app name
Example: fastro init --app myapp`;
export const otp_msg = `Usage: fastro otp`;
export const token_msg = `Usage: fastro token [option]
Option: --otp : your otp. get from 'fastro otp' command.
Example: fastro token --otp 1234567`;
export const handler_msg = `Usage: fastro createHandler [options]
Options: --name : handler name --prefix: handler prefix
Example: fastro createHandler --name api --prefix v1`;
export const harmful_msg = `Deployment failed. For security reasons, you are not allowed to run Deno runtime API.`;
export const handler_content = `import { Request } from "https://raw.fastro.dev/v${version.fastro}/mod.ts";import { getMessage } from "../services/message_service.ts";
export function handler(req: Request) { const { message } = getMessage(); req.send(message);} `;
export const create_handler_content = `import { Request } from "https://raw.fastro.dev/v${version.fastro}/mod.ts";
export function handler(req: Request) { req.send({ message: "Hello world" });}`;
export const service_content = `export function getMessage() { return { message: "Server setup complete" };} `;
export const html_content = `<html>
<head> <style> html, body { height: 100%; margin: 0; padding: 0; font-family: Roboto, Helvetica, Arial, sans-serif; background: #ECEFF1; color: rgba(0, 0, 0, 0.87); } div { position: relative; height: 100%; width: 100%; } div #ctnr { text-align: center; position: absolute; top: 0; left: 0; right: 0; bottom: 0; margin: auto; width: 200; height: 90; border-radius: 3px; background-color: white; padding: 20; } #ctnr { box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24); } </style> </head> <body> <div> <div id="ctnr"> <img src="logo.svg" width="100" style="margin: auto;"> <div id="msg" style="margin-top:10"></div> </div> </div> </body> <script> async function get() { const data = await fetch("/api"); const d = await data.text() document.getElementById("msg").innerHTML = d } get(); </script> </html> `;
export const logo_content = `<svg version="1.1" viewBox="0.0 0.0 80.0 50.0" fill="none" stroke="none" stroke-linecap="square" stroke-miterlimit="10" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg"><clipPath id="p.0"><path d="m0 0l80.0 0l0 50.0l-80.0 0l0 -50.0z" clip-rule="nonzero"/></clipPath><g clip-path="url(#p.0)"><path fill="#000000" fill-opacity="0.0" d="m0 0l80.0 0l0 50.0l-80.0 0z" fill-rule="evenodd"/><path fill="#000000" fill-opacity="0.0" d="m-1.8740157 0l83.74803 0l0 44.188976l-83.74803 0z" fill-rule="evenodd"/><path fill="#000000" d="m62.89427 31.478867l-11.875 0l-6.546875 17.015625l-13.9375 0l17.8125 -45.828125l28.59375 0l-6.375 11.734375l-12.90625 0l-2.34375 6.15625l11.890625 0l-4.3125 10.921875zm-34.5 16.796875l-30.390625 -3.296875l31.671875 0l-1.28125 3.296875zm5.5 -14.15625l-30.40625 -3.296875l31.6875 0l-1.28125 3.296875zm2.734375 -7.03125l-30.390625 -3.3125l31.671875 0l-1.28125 3.3125zm2.75 -7.046875l-30.390625 -3.296875l31.671875 0l-1.28125 3.296875zm2.734375 -7.03125l-30.375 -3.3125l31.59375 0l-1.21875 3.3125zm-10.96875 28.15625l-30.375 -3.296875l31.671875 0l-1.296875 3.296875zm13.65625 -35.203125l-30.34375 -3.296875l31.609375 0l-1.265625 3.296875z" fill-rule="nonzero"/></g></svg>`;