ulsdevteam / ccvgd-frontend Goto Github PK
View Code? Open in Web Editor NEWContemporary Chinese Village Gazetteer Data front end application
License: MIT License
Contemporary Chinese Village Gazetteer Data front end application
License: MIT License
When deployed as an application in an Apache document root, the application responds and re-writes the public-facing URLs to endpoints such as /single-village-search
and /multi-village-search
.
but direct fetches of these endpoints result in 404s.
What is the expected server-level redirection needed to ensure that public facing URLs are directed to the js application?
Configuring a production build with the environment:
export const environment = {
production: true,
//backend service will run on this API ROOT, which points to the server
API_ROOT: "//test.hostname.tld:8001/api/",
};
Constructs backend API calls such as:
http://test.hostname.tld:8001/api/ccvg/namesearch
But there is no guarantee that "ccvg" is a prefix in the deployment of the backend.
The application expects to be deployed in the webroot, and will reference the javascript includes via an absolute path.
For example, deploying to "http://localhost/ccvgd/" will look for runtime-es2015.a1ac991fc00ebf39524f.js
in "http://localhost/runtime-es2015.a1ac991fc00ebf39524f.js"
This should be configurable, or should be documented within the readme.
In src/environments/environment*.ts
, we have a single key for API_ROOT
, with an example of an "http" endpoint. E.g.:
This application itself should be able to be served over HTTP or HTTPS, at the end user's preference.
Because this API endpoint is called from the end user's web browser, via the application itself, this configuration would suggest that either the entire application should be placed behind a proxy, or that the backend API should be available to the end user via both HTTP and HTTPS.
If the example deployment will reference an HTTP endpoint, the example should also so how to configure an HTTPS endpoint as well.
If the example deployment references a relative path (that is, API_ROOT: "/backend-api/"
or API_ROOT: "//localhost/backend/"
), then the determination of HTTP or HTTPS can be left to the administrator who is installing the application.
Almost certainly files under dist/
and node_modules/
should be included in the a .gitignore
so that the git repository is only tracking local source code changes. The dependencies and the packaged application should only exist in deployed packages (releases), or left to the administrator to deploy when the application is installed.
To capture the state of the the application when it has been tested with specific dependencies, you will want to include the package-lock.json
file in the git repository. If specific dependency versions are non-critical, you may want to exclude the package-lock.json
file via the .gitignore
.
For configuration files where the administrator who is deploying the application has choices to make (such as database names, passwords, backend hostnames, ports, etc.), the git repo should provide sample files or sample values, with instructions to the administrator for changes. For example, consider src/environments/environment.prod.ts
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.